ci: lint the excluded sharpearena-py crate #55
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| rust: | |
| name: fmt · clippy · test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # Pin to the rust-toolchain.toml channel (1.96.0) so the wasm32 target lands on | |
| # the toolchain cargo actually builds with. With @stable the target is added to | |
| # stable, but the build uses 1.96.0 (rust-toolchain.toml) and can't find std. | |
| - name: Install Rust 1.96.0 (+ wasm target) | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.96.0" | |
| components: rustfmt, clippy | |
| targets: wasm32-unknown-unknown | |
| - name: Format | |
| run: cargo fmt --all --check | |
| - name: Clippy (deny warnings) | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Test | |
| run: cargo test --workspace | |
| - name: WASM target builds | |
| run: cargo build -p sharpearena-wasm --target wasm32-unknown-unknown --release | |
| supply-chain: | |
| name: cargo-deny (licenses · advisories · bans · sources) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| command: check | |
| npm: | |
| name: npm (wasm wrapper) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| - name: install · build · test (against the committed wasm pkg) | |
| working-directory: npm/sharpearena | |
| run: | | |
| npm ci | |
| npm run build | |
| npm test | |
| python: | |
| name: sharpearena-py (fmt, clippy, maturin, pytest) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust 1.96.0 | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.96.0" | |
| components: rustfmt, clippy | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| # crates/sharpearena-py is `exclude`d from the workspace, so the `rust` job's | |
| # root `cargo fmt --all` / `cargo clippy --all-targets` never reach it: both | |
| # resolve against workspace members only. Run them from inside the crate dir, | |
| # which is the only way to lint an excluded crate. | |
| - name: Format | |
| working-directory: crates/sharpearena-py | |
| run: cargo fmt -- --check | |
| - name: Clippy (deny warnings) | |
| working-directory: crates/sharpearena-py | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: maturin develop + pytest (in a venv) | |
| working-directory: crates/sharpearena-py | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip maturin pytest numpy gymnasium verifiers | |
| maturin develop | |
| python -m pytest -q |