ci: Split CI lanes into reusable workflows #1896
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - "release/**" | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| RUSTFLAGS: -Dwarnings | |
| jobs: | |
| lints: | |
| name: Lints | |
| uses: ./.github/workflows/reusable-lint.yml | |
| check: | |
| uses: ./.github/workflows/reusable-check.yml | |
| test: | |
| uses: ./.github/workflows/reusable-test.yml | |
| codecov: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: rustup component add llvm-tools-preview | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: taiki-e/install-action@cargo-llvm-cov | |
| - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --locked | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| files: lcov.info | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| doc: | |
| name: Build-test documentation | |
| uses: ./.github/workflows/reusable-doc.yml | |
| required: | |
| name: Check required jobs | |
| runs-on: ubuntu-latest | |
| if: ${{ always() }} | |
| # Keep this list in sync with all CI jobs that should be required. | |
| # `codecov` is intentionally excluded from this aggregator. | |
| needs: [lints, check, test, doc] | |
| steps: | |
| - name: Fail if any required job did not succeed | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') || | |
| contains(needs.*.result, 'cancelled') || | |
| contains(needs.*.result, 'skipped') | |
| }} | |
| run: exit 1 |