|
| 1 | +# SPDX-FileCopyrightText: 2026 Blackcat Informatics® Inc. <paudley@blackcatinformatics.ca> |
| 2 | +# SPDX-License-Identifier: MIT OR Apache-2.0 |
| 3 | +name: CI |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [main] |
| 8 | + pull_request: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ci-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +jobs: |
| 18 | + rust: |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 26 | + with: |
| 27 | + persist-credentials: false |
| 28 | + |
| 29 | + - name: Install Rust |
| 30 | + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable |
| 31 | + with: |
| 32 | + components: clippy, rustfmt |
| 33 | + targets: wasm32-unknown-unknown |
| 34 | + |
| 35 | + - name: Cache Cargo dependencies |
| 36 | + uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 |
| 37 | + |
| 38 | + - name: Format |
| 39 | + if: runner.os == 'Linux' |
| 40 | + run: cargo fmt --check |
| 41 | + |
| 42 | + - name: Clippy |
| 43 | + if: runner.os == 'Linux' |
| 44 | + run: cargo clippy --all-targets -- -D warnings |
| 45 | + |
| 46 | + - name: Rustdoc |
| 47 | + if: runner.os == 'Linux' |
| 48 | + env: |
| 49 | + RUSTDOCFLAGS: -D warnings |
| 50 | + run: cargo doc --no-deps |
| 51 | + |
| 52 | + - name: Test |
| 53 | + run: cargo test --locked |
| 54 | + |
| 55 | + - name: Wasm library build |
| 56 | + if: runner.os == 'Linux' |
| 57 | + run: cargo build --lib --target wasm32-unknown-unknown |
| 58 | + |
| 59 | + - name: Package dry-run |
| 60 | + if: runner.os == 'Linux' |
| 61 | + run: cargo publish --locked --dry-run |
0 commit comments