Skip to content

Commit

Permalink
feat: Rebase on 0.41.0
Browse files Browse the repository at this point in the history
Tests passing with WASI.
CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime -S common --dir ."
  • Loading branch information
cdmurph32 committed Feb 4, 2025
1 parent c93018d commit 21141b2
Show file tree
Hide file tree
Showing 21 changed files with 287 additions and 1,372 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,59 @@ 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
# container:
# image: ghcr.io/webassembly/wasi-sdk

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
ls wasi*
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 common --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

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

0 comments on commit 21141b2

Please sign in to comment.