diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 263ca59..eee8955 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,15 @@ name: CI on: push: - branches: [main] + branches: + - main + paths-ignore: + - '**.md' + - '**.html' pull_request: - branches: [main] + paths-ignore: + - '**.md' + - '**.html' # Cancel any in-flight jobs for the same PR/branch so there's only one active at a time concurrency: @@ -18,6 +24,19 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - run: pip install mypy wasmtime + + - uses: actions/checkout@v3 + with: + repository: singlestore-labs/writ + path: writ + - run: | + echo "$GITHUB_WORKSPACE/writ/bin" >> $GITHUB_PATH + chmod +x $GITHUB_WORKSPACE/writ/bin/writ + - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -36,11 +55,6 @@ jobs: curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-linux.tar.gz -L | tar xzvf - -C $GITHUB_WORKSPACE/ echo "$GITHUB_WORKSPACE/wasi-sdk-16.0/bin" >> $GITHUB_PATH - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - run: pip install mypy wasmtime - - name: Test cpp build run: make cpp-debug cpp-release working-directory: ./examples diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index fc94612..aaf5319 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -4,10 +4,13 @@ on: push: paths: - '**.md' + - '**.html' branches: - main pull_request: - + paths: + - '**.md' + - '**.html' jobs: deploy: runs-on: ubuntu-latest diff --git a/examples/Makefile b/examples/Makefile index 13547f6..5bbd672 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -21,7 +21,7 @@ cpp: echo "=====================================================" ; \ echo "Building CPP example '`basename $$D`'" ; \ echo "=====================================================" ; \ - make -C $$D $(TARGET) ; \ + make -C $$D $(TARGET) test; \ done ############################################################################## @@ -40,7 +40,7 @@ rust: echo "=====================================================" ; \ echo "Building Rust example '`basename $$D`'" ; \ echo "=====================================================" ; \ - make -C $$D $(TARGET) ; \ + make -C $$D $(TARGET) test; \ done ############################################################################## diff --git a/examples/cpp/power/Makefile b/examples/cpp/power/Makefile index 77133e1..fc8fd27 100644 --- a/examples/cpp/power/Makefile +++ b/examples/cpp/power/Makefile @@ -16,7 +16,7 @@ power.wasm: gen power.c .PHONY: test -test: debug +test: writ --expect 8 --wit power.wit power.wasm power-of 2 3 @echo PASS writ --expect 1 --wit power.wit power.wasm power-of 2 0 diff --git a/examples/cpp/split/Makefile b/examples/cpp/split/Makefile index 50191c4..0b42015 100644 --- a/examples/cpp/split/Makefile +++ b/examples/cpp/split/Makefile @@ -17,7 +17,7 @@ split.wasm: gen split_impl.cpp .PHONY: test -test: debug +test: writ \ -e '[{"str": "hello", "idx": 0}, {"str": "there", "idx": 6}, {"str": "people", "idx": 12}]' \ --wit split.wit split.wasm split-str "hello there people" " " diff --git a/examples/rust/dates/Makefile b/examples/rust/dates/Makefile index 6b00a06..410da02 100644 --- a/examples/rust/dates/Makefile +++ b/examples/rust/dates/Makefile @@ -14,11 +14,12 @@ wasm: cargo wasi build --lib $(RELFLAGS) .PHONY: test -test: debug +test: writ \ -e "2022-07-30" \ --wit $(MODULE).wit target/wasm32-wasi/debug/$(MODULE).wasm next-saturday \ "2022-07-23" + cargo wasi test @echo PASS .PHONY: clean diff --git a/examples/rust/echo-remote-debug/Makefile b/examples/rust/echo-remote-debug/Makefile index af51617..d1d04fc 100644 --- a/examples/rust/echo-remote-debug/Makefile +++ b/examples/rust/echo-remote-debug/Makefile @@ -14,7 +14,7 @@ wasm: cargo wasi build --lib $(RELFLAGS) .PHONY: test -test: debug +test: writ \ -e "hello there hello there" \ --wit $(MODULE).wit target/wasm32-wasi/debug/$(MODULE).wasm echo \ diff --git a/examples/rust/sentimentable/Makefile b/examples/rust/sentimentable/Makefile index f30ebb4..215356c 100644 --- a/examples/rust/sentimentable/Makefile +++ b/examples/rust/sentimentable/Makefile @@ -14,7 +14,7 @@ wasm: cargo wasi build --lib $(RELFLAGS) .PHONY: test -test: debug +test: writ \ -e '[{"compound": 0.5573704017131537, "positive": 0.5454545454545455, "negative": 0.0, "neutral": 0.4545454545454546 }]' \ --wit $(MODULE).wit target/wasm32-wasi/debug/$(MODULE).wasm sentimentable\ diff --git a/examples/rust/split/Makefile b/examples/rust/split/Makefile index ac7ba97..4fd754a 100644 --- a/examples/rust/split/Makefile +++ b/examples/rust/split/Makefile @@ -14,7 +14,7 @@ wasm: cargo wasi build --lib $(RELFLAGS) .PHONY: test -test: debug +test: writ \ -e '[{"str": "hello", "idx": 0}, {"str": "there", "idx": 6}, {"str": "people", "idx": 12}]' \ --wit $(MODULE).wit target/wasm32-wasi/debug/$(MODULE).wasm split-str \ diff --git a/examples/rust/usergenerator-remote-debug/Makefile b/examples/rust/usergenerator-remote-debug/Makefile index c546aff..3cfdbc6 100644 --- a/examples/rust/usergenerator-remote-debug/Makefile +++ b/examples/rust/usergenerator-remote-debug/Makefile @@ -16,7 +16,7 @@ wasm: # This function produces random output, so we can't check it against a # standard. Instead, just verify that it runs without error. .PHONY: test -test: debug +test: writ --wit $(MODULE).wit target/wasm32-wasi/debug/$(MODULE).wasm gen-users 3 @echo PASS diff --git a/examples/rust/usergenerator/Makefile b/examples/rust/usergenerator/Makefile index c546aff..3cfdbc6 100644 --- a/examples/rust/usergenerator/Makefile +++ b/examples/rust/usergenerator/Makefile @@ -16,7 +16,7 @@ wasm: # This function produces random output, so we can't check it against a # standard. Instead, just verify that it runs without error. .PHONY: test -test: debug +test: writ --wit $(MODULE).wit target/wasm32-wasi/debug/$(MODULE).wasm gen-users 3 @echo PASS