adopt wit-dylib
#268
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "examples/**" | |
| - "README.md" | |
| - "CONTRIBUTING.md" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| WASI_SDK_VERSION: 27 | |
| jobs: | |
| linux: | |
| name: Populate cache | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14.0-rc.3" | |
| - name: Install latest Rust nightly toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: wasm32-wasip1 wasm32-unknown-unknown | |
| - name: Install latest Rust stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-wasip1 wasm32-unknown-unknown | |
| components: clippy, rustfmt | |
| - name: Install Rust std source | |
| shell: bash | |
| run: rustup component add rust-src --toolchain nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "rust-cache-${{ hashFiles('./Cargo.lock') }}" | |
| cache-on-failure: false | |
| - name: Install WASI-SDK | |
| shell: bash | |
| run: | | |
| cd /tmp | |
| curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz | |
| tar xf wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz | |
| mv wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux /opt/wasi-sdk | |
| - name: Build | |
| shell: bash | |
| run: cargo build --release | |
| - name: Upload CPython builddir | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cpython-wasi | |
| path: cpython/builddir/wasi | |
| test: | |
| name: Test | |
| needs: linux | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - { os: "ubuntu-latest", wasiSDK: "x86_64-linux" } | |
| - { os: "macos-latest", wasiSDK: "arm64-macos" } | |
| - { os: "windows-latest", wasiSDK: "x86_64-windows" } | |
| runs-on: ${{ matrix.config.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - name: Install latest Rust nightly toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: wasm32-wasip1 wasm32-unknown-unknown | |
| - name: Install latest Rust stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-wasip1 wasm32-unknown-unknown | |
| components: clippy, rustfmt | |
| - name: Install Rust std source | |
| shell: bash | |
| run: rustup component add rust-src --toolchain nightly | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "rust-cache-${{ hashFiles('./Cargo.lock') }}" | |
| cache-on-failure: false | |
| - name: Download WASI-SDK | |
| shell: bash | |
| run: | | |
| cd /tmp | |
| curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }}.tar.gz | |
| tar xf wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }}.tar.gz | |
| - name: Install WASI-SDK | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: sudo mv /tmp/wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }} /opt/wasi-sdk | |
| - name: Install WASI-SDK on Windows | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: echo "WASI_SDK_PATH=$(cygpath -m /tmp/wasi-sdk-${WASI_SDK_VERSION}.0-${{ matrix.config.wasiSDK }})" >> ${GITHUB_ENV} | |
| - name: Restore CPython | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: cpython-wasi | |
| path: cpython/builddir/wasi | |
| - name: Lint | |
| shell: bash | |
| run: bash .github/workflows/lint.sh | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: wasmtime-cli | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14.0-rc.3" | |
| - name: Test | |
| shell: bash | |
| run: COMPONENTIZE_PY_TEST_COUNT=20 PROPTEST_MAX_SHRINK_ITERS=0 cargo test --release |