Continuous Integration #2034
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: Continuous Integration | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - "**/*.md" | |
| push: | |
| branches: | |
| - main | |
| - "renovate/**" | |
| paths-ignore: | |
| - "**/*.md" | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| merge_group: | |
| types: [checks_requested] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1 | |
| with: | |
| toolchain: stable | |
| components: rustfmt | |
| - name: Run Cargo Fmt | |
| run: cargo fmt --all -- --check | |
| typos: | |
| name: Typos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Check for typos | |
| uses: crate-ci/typos@80c8a4945eec0f6d464eaf9e65ed98ef085283d1 # v1.38.1 | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| feature: [release] | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1 | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2 | |
| - name: Run clippy | |
| run: cargo clippy --locked --all-targets --features ${{ matrix.feature }} -- -D warnings | |
| test: | |
| name: Test | |
| runs-on: ${{ matrix.job.os }} | |
| strategy: | |
| # Don't fail fast, so we can actually see all the results | |
| fail-fast: false | |
| matrix: | |
| rust: [stable] | |
| feature: [release] | |
| job: | |
| - os: macos-latest | |
| - os: ubuntu-latest | |
| - os: windows-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1 | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2 | |
| - name: Run Cargo Test | |
| run: cargo test -r --all-targets --features ${{ matrix.feature }} --workspace | |
| id: run_tests | |
| env: | |
| INSTA_UPDATE: new | |
| - name: Upload snapshots of failed tests | |
| if: ${{ failure() && steps.run_tests.outcome == 'failure' }} | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: failed-snapshots-${{ matrix.job.os }} | |
| path: "**/snapshots/*.snap.new" | |
| docs: | |
| name: Build docs | |
| runs-on: ${{ matrix.job.os }} | |
| strategy: | |
| matrix: | |
| rust: [stable] | |
| job: | |
| - os: macos-latest | |
| - os: ubuntu-latest | |
| - os: windows-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # v1 | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2 | |
| - name: Run Cargo Doc | |
| run: cargo doc --no-deps --all-features --workspace --examples | |
| result: | |
| name: Result (CI) | |
| runs-on: ubuntu-latest | |
| needs: | |
| - fmt | |
| - clippy | |
| - test | |
| - docs | |
| steps: | |
| - name: Mark the job as successful | |
| run: exit 0 | |
| if: success() | |
| - name: Mark the job as unsuccessful | |
| run: exit 1 | |
| if: "!success()" |