ci: workflow to pre-build WASM binaries #766
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: CI | |
| # yamllint disable-line rule:truthy | |
| on: | |
| merge_group: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| fetch-depth: 1 | |
| - name: Fetch main branch | |
| run: git fetch --depth=1 origin main | |
| - name: Free disk space | |
| uses: ./.github/actions/free-disk-space | |
| - name: Install `yamllint` | |
| run: pip install --requirement=.github/workflows/requirements.txt | |
| - name: Install `cargo-deny` & `just` & 'typos' | |
| uses: taiki-e/install-action@763e3324d4fd026c9bd284c504378585777a87d5 # v2 | |
| with: | |
| tool: cargo-deny,just,typos | |
| - name: Install `tombi` | |
| uses: tombi-toml/setup-tombi@a9378ac9fe5c29df7d26263deacea4ac642af9c2 # v1 | |
| - name: Install stable toolchain | |
| uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master | |
| with: | |
| components: clippy, rustfmt | |
| toolchain: stable | |
| targets: wasm32-wasip2 | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 | |
| # Swatinem/rust-cache does NOT cache docs, see | |
| # https://github.com/Swatinem/rust-cache/issues/208 | |
| - name: Rustdoc Cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: target/doc | |
| key: v0-${{ runner.os }}-rustdoc-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| v0-${{ runner.os }}-rustdoc-${{ hashFiles('**/Cargo.lock') }} | |
| v0-${{ runner.os }}-rustdoc- | |
| - name: just check | |
| run: just check | |
| env: | |
| # Disable incremental compilation to avoid overhead. | |
| CARGO_INCREMENTAL: "0" | |
| # Disable full debug symbol generation to speed up CI build | |
| # "1" means line tables only, which is useful for panic tracebacks. | |
| CARGO_PROFILE_DEV_DEBUG: "1" | |
| - name: Check Cargo.lock | |
| shell: bash | |
| run: | | |
| if ! git diff --exit-code -- Cargo.lock; then | |
| echo "::error::Cargo.lock changed, please commit your local changes!" | |
| exit 1 | |
| else | |
| echo "Good. Cargo.lock is up to date" | |
| fi | |
| - name: upload docs | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: docs | |
| path: target/doc | |
| if-no-files-found: error |