build #31
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: build | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: '0 3 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ubuntu-latest, macos-latest, windows-latest] | |
| toolchain: [stable] | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout Sources | |
| uses: actions/checkout@v5 | |
| - name: Cache Dependencies & Build Outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install Rust Toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| components: rustfmt, clippy | |
| - name: Check Code Format | |
| run: cargo fmt --all -- --check | |
| shell: bash | |
| - name: Code Lint | |
| run: cargo clippy --all-targets --all-features --workspace -- -D warnings | |
| shell: bash | |
| - name: Test | |
| run: cargo test --all-features --workspace | |
| shell: bash | |
| ensure_no_std: | |
| name: Ensure no_std | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Sources | |
| uses: actions/checkout@v5 | |
| - name: Install Rust Toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: thumbv6m-none-eabi | |
| - name: Build | |
| run: cargo build --no-default-features --target thumbv6m-none-eabi | |
| shell: bash | |
| msrv: | |
| name: Verify MSRV (1.85) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Sources | |
| uses: actions/checkout@v5 | |
| - name: Install Rust Toolchain (1.85) | |
| uses: dtolnay/rust-toolchain@1.85.0 | |
| - name: Check | |
| run: cargo check --all-features --workspace | |
| shell: bash | |
| - name: Check CLI | |
| run: cargo check --manifest-path cli/Cargo.toml | |
| shell: bash | |
| audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Sources | |
| uses: actions/checkout@v5 | |
| - name: Install Rust Toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| shell: bash | |
| - name: Run cargo audit | |
| run: cargo audit | |
| shell: bash | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Sources | |
| uses: actions/checkout@v5 | |
| - name: Install Rust Toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Generate Code Coverage | |
| run: | | |
| cargo install cargo-tarpaulin | |
| cargo tarpaulin --all-features --out Xml | |
| shell: bash | |
| - name: Upload Code Coverage | |
| uses: codecov/codecov-action@v5 | |
| fuzz: | |
| name: Fuzz | |
| runs-on: ubuntu-latest | |
| # Bounded fuzzing is expensive. Only run on schedule or manual dispatch | |
| # to avoid exhausting CI minutes; regular push/PR CI already covers | |
| # fmt, clippy, audit, MSRV, no_std, and coverage. | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout Sources | |
| uses: actions/checkout@v5 | |
| - name: Install Rust Toolchain (nightly) | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Cache Dependencies & Build Outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo | |
| target | |
| fuzz/target | |
| key: ${{ runner.os }}-fuzz-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install cargo-fuzz | |
| run: cargo install cargo-fuzz | |
| shell: bash | |
| - name: Run fuzz_decode (60s) | |
| run: cargo fuzz run fuzz_decode -- -max_total_time=60 | |
| working-directory: fuzz | |
| shell: bash | |
| - name: Run fuzz_encode (60s) | |
| run: cargo fuzz run fuzz_encode -- -max_total_time=60 | |
| working-directory: fuzz | |
| shell: bash | |
| - name: Run fuzz_roundtrip (60s) | |
| run: cargo fuzz run fuzz_roundtrip -- -max_total_time=60 | |
| working-directory: fuzz | |
| shell: bash |