chore(deps): refresh infrastructure baselines #2216
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 Rust | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| branches: [main] | |
| paths: | |
| - 'rsworkspace/**' | |
| - '.mise.toml' | |
| - '.config/mise/tasks/**' | |
| - '.github/workflows/ci-rust.yml' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - uses: jdx/mise-action@v4.0.1 | |
| - name: Install Rust components | |
| run: rustup component add rustfmt clippy | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2.9.1 | |
| with: | |
| workspaces: rsworkspace -> target | |
| save-if: always | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| working-directory: rsworkspace | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features | |
| working-directory: rsworkspace | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: true | |
| - uses: jdx/mise-action@v4.0.1 | |
| - name: Install Rust components | |
| run: rustup component add llvm-tools-preview | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2.9.1 | |
| with: | |
| workspaces: rsworkspace -> target | |
| save-if: always | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-llvm-cov | |
| - name: Run tests with coverage | |
| run: cargo cov --cobertura --output-path coverage.xml | |
| working-directory: rsworkspace | |
| - name: Coverage report and gate | |
| # TODO: Add a fork-safe read-only coverage comparison path; this action writes to | |
| # _xml_coverage_reports, but fork PR tokens cannot push to the base repo. | |
| uses: insightsengineering/coverage-action@v3 | |
| with: | |
| path: rsworkspace/coverage.xml | |
| threshold: 95 | |
| fail: true | |
| publish: true | |
| diff: true | |
| diff-branch: main | |
| diff-storage: _xml_coverage_reports | |
| uncovered-statements-increase-failure: ${{ !contains(github.event.pull_request.labels.*.name, 'rust:coverage-baseline-reset') }} | |
| new-uncovered-statements-failure: ${{ !contains(github.event.pull_request.labels.*.name, 'rust:coverage-baseline-reset') }} | |
| coverage-rate-reduction-failure: ${{ !contains(github.event.pull_request.labels.*.name, 'rust:coverage-baseline-reset') }} | |
| togglable-report: true | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - uses: jdx/mise-action@v4.0.1 | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2.9.1 | |
| with: | |
| workspaces: rsworkspace -> target | |
| save-if: always | |
| - name: Build release | |
| run: cargo build --release | |
| working-directory: rsworkspace |