Skip to content
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

feat: Wasm32 wasi 0.41.0 #888

Merged
merged 8 commits into from
Feb 18, 2025
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
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,56 @@ jobs:
run: wasm-pack test --chrome --headless
working-directory: ./cawg_identity

tests-wasi:
name: Unit tests (WASI)
if: |
github.event_name != 'pull_request' ||
github.event.pull_request.author_association == 'COLLABORATOR' ||
github.event.pull_request.author_association == 'MEMBER' ||
github.event.pull_request.user.login == 'dependabot[bot]' ||
contains(github.event.pull_request.labels.*.name, 'safe to test')

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

# nightly required for testing until this issue is resolved:
# wasip2 target should not conditionally feature gate stdlib APIs rust-lang/rust#130323 https://github.com/rust-lang/rust/issues/130323
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly

- name: Install wasmtime
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH

- name: Install WASI SDK
run: |
if [ "${RUNNER_ARCH}" = "X64" ]; then
ARCH="x86_64";
else
ARCH="${RUNNER_ARCH}";
fi
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-${ARCH}-${RUNNER_OS}.tar.gz
tar xvf wasi-sdk-25.0-${ARCH}-${RUNNER_OS}.tar.gz
mv $(echo wasi-sdk-25.0-${ARCH}-${RUNNER_OS} | tr '[:upper:]' '[:lower:]') /opt/wasi-sdk

- name: Add wasm32-wasip2 target
run: rustup target add --toolchain nightly wasm32-wasip2

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Run WASI tests (c2pa-rs)
env:
CARGO_TARGET_WASM32_WASIP2_RUNNER: "wasmtime -S cli -S http --dir ."
CC: /opt/wasi-sdk/bin/clang
WASI_SDK_PATH: /opt/wasi-sdk
RUST_MIN_STACK: 16777216
run: cargo +nightly test --target wasm32-wasip2 -p c2pa -p c2pa-crypto --all-features

test-direct-minimal-versions:
name: Unit tests with minimum versions of direct dependencies
if: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/target/

**/*.rs.bk
**/*.tmp*

.DS_Store
.idea
Expand Down
Loading
Loading