Skip to content

Make ada-rust compile for wasm32-wasi and -unknown #23

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 4 commits into from
Aug 21, 2023
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
47 changes: 19 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,32 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
check:
name: Check
test:
name: Check & Test
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: macos-latest
- os: ubuntu-latest
env:
CARGO_BUILD_TARGET: wasm32-wasi
CARGO_TARGET_WASM32_WASI_RUNNER: /home/runner/.wasmtime/bin/wasmtime --dir=.
runs-on: ${{ matrix.os }}
env: ${{ matrix.env || fromJSON('{}') }}
steps:
- uses: actions/checkout@v3

- name: Install Wasm deps
if: matrix.env.CARGO_BUILD_TARGET == 'wasm32-wasi'
run: |
rustup target add wasm32-wasi
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk_20.0_amd64.deb
sudo dpkg --install wasi-sdk_20.0_amd64.deb
curl https://wasmtime.dev/install.sh -sSf | bash

- uses: Swatinem/rust-cache@v2
with:
shared-key: ci
Expand All @@ -37,10 +50,10 @@ jobs:
- run: rustup show

- name: Cargo Check
shell: bash
run: |
cargo check --all-targets --all-features --locked
cargo test --no-run --all-targets --all-features
run: cargo check --all-targets --all-features --locked

- name: Cargo Test
run: cargo test --all-targets --all-features

format:
name: Format
Expand All @@ -66,25 +79,3 @@ jobs:
- run: rustup show

- run: cargo clippy -- -D warnings

test:
name: Test
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- uses: Swatinem/rust-cache@v2
with:
shared-key: ci
save-if: false

- run: rustup show

- run: cargo test
215 changes: 2 additions & 213 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ thiserror = "1"
serde = { version = "1.0", optional = true, features = ["derive"] }

[dev-dependencies]
criterion = "0.5"
criterion = { version = "0.5", default-features = false, features = ["cargo_bench_support"] }
url = "2" # Used by benchmarks
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[build-dependencies]
cc = { version = "1.0", features = ["parallel"] }
cc = { version = "1.0.83", features = ["parallel"] }
link_args = "0.6"

[package.metadata.docs.rs]
Expand Down
Loading