Skip to content
Draft

Spec #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
run: make all use_sccache=true WASI_SDK_PATH=$WASI_SDK_PATH numjobs=3

- name: Upload runtime
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v3
with:
name: runtime
Expand All @@ -49,6 +48,22 @@ jobs:
shell: bash
run: ${SCCACHE_PATH} --show-stats

test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Get runtime
uses: actions/download-artifact@v3
with:
name: runtime

- name: Run tests
run: make test

release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
*.wat
*.phar
debugger*
/integration-tests/fixtures/*/bundle.wasm
/integration-tests/target
/integration-test-runner
/stub-gen
/stub-generator/target
/*.stubs.php
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
]

exclude = [
"integration-tests",
"stub-generator",
]

Expand Down
31 changes: 22 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,28 @@ deps/php/libs/libphp.a: export NM := ${NM}
deps/php/libs/libphp.a: deps/php/Makefile
cd deps/php && make ${numjobs_flag} libphp.la

.PHONY: clean cargo-clean
clean:
@rm -rf runtime.wasm deps/
.PHONY: test
test: | runtime.wasm integration-test

.PHONY: integration-test
integration-test: integration-test-runner
./integration-test-runner $(PWD)/integration-tests/fixtures $(PWD)/runtime.wasm

integration-test-runner:
cargo build --target=$(HOST_TARGET_TRIPLE) --release --manifest-path=integration-tests/Cargo.toml && \
cp integration-tests/target/$(HOST_TARGET_TRIPLE)/release/integration-tests integration-test-runner

.PHONY: clean
clean: cargo-clean tests-clean
@rm -rf runtime.wasm runtime.wat deps/

.PHONY: tests-clean
tests-clean:
@rm -rf integration-test-runner integration-tests/target

.PHONY: cargo-clean
cargo-clean:
cargo clean

fastly-php-runtime.stubs.php: runtime.wasm stub-gen
./stub-gen runtime.wasm > fastly-php-runtime.stubs.php
Expand All @@ -185,9 +204,3 @@ stub-gen:

.PHONY: all
all: runtime.wasm fastly-php-runtime.stubs.php

.PHONY: test
test: runtime.wasm integration-test

cargo-clean: clean
cargo clean
Loading