Skip to content

test: Ensure the custom_wasmer_runtime tag works #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 23, 2021
Merged
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
19 changes: 18 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:

- id: 'darwin-amd64'
os: 'macos-latest'

- id: 'linux-amd64'
os: 'ubuntu-18.04'
libwasmer_archive_name: 'wasmer-linux-amd64.tar.gz'
fail-fast: true

runs-on: ${{ matrix.target.os }}
Expand All @@ -49,11 +53,24 @@ jobs:
export PATH="$HOME/.cargo/bin:$PATH"
cargo install just

- name: Run all the tests
- name: Run all the tests (default)
if: ${{ !matrix.target.libwasmer_archive_name }}
shell: bash
run: |
just test

- name: Run all the tests (with custom Wasmer runtime)
if: matrix.target.libwasmer_archive_name
shell: bash
run: |
libwasmer_url=$(curl -s https://api.github.com/repos/wasmerio/wasmer-nightly/releases/latest | jq --raw-output '.assets[] | select(.name == "${{ matrix.target.libwasmer_archive_name }}") | .browser_download_url')
mkdir -p libwasmer
curl -L $libwasmer_url > release.tar.gz
tar xzvf release.tar.gz -C libwasmer
export CGO_CFLAGS="-I$(pwd)/libwasmer/include/"
export CGO_LDFLAGS="-Wl,-rpath,$(pwd)/libwasmer/lib/ -L$(pwd)/libwasmer/lib/ -lwasmer"
just test -tags custom_wasmer_runtime

- name: Run all the examples
shell: bash
run: |
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ this library works (and is tested) on the following platforms:
$ export CGO_LDFLAGS="-Wl,-rpath,$(pwd)/target/release/ -L$(pwd)/target/release/ -lwasmer_go"
$
$ # Run the tests.
$ cd wasmer
$ go test -v -tags custom_wasmer_runtime
$ just test -tags custom_wasmer_runtime
```
</details>

Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Run all the tests.
test:
test *ARGS:
#!/usr/bin/env bash
cd wasmer
# Run the tests.
GODEBUG=cgocheck=2 go test -v
GODEBUG=cgocheck=2 go test -v {{ARGS}}

examples:
#!/usr/bin/env bash
Expand Down