ci: enforce workflow-level RUSTFLAGS in CI #1888
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: | |
| env: | |
| RUSTFLAGS: -Dwarnings | |
| jobs: | |
| lints: | |
| name: Lints | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - run: rustup component add rustfmt clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo fmt | |
| run: cargo fmt --all -- --check | |
| - name: Run cargo clippy | |
| run: cargo clippy --all-features --workspace --tests --examples -- -D clippy::all | |
| check: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| name: Check feature permutations using Rust stable on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check all features | |
| run: cargo check --all-features | |
| - name: Check sentry-core without default features | |
| run: cargo check --no-default-features | |
| working-directory: sentry-core | |
| - name: Check default features | |
| run: cargo check | |
| - name: Check sentry panic feature without defaults | |
| run: cargo check --no-default-features --features panic | |
| working-directory: sentry | |
| - name: Check sentry curl feature | |
| run: cargo check --features curl | |
| working-directory: sentry | |
| - name: Check sentry curl+panic without defaults | |
| run: cargo check --no-default-features --features curl,panic | |
| working-directory: sentry | |
| - name: Check sentry-actix | |
| run: cargo check | |
| working-directory: sentry-actix | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| name: Test using Rust stable on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo test | |
| run: cargo test --workspace --all-features --all-targets | |
| MSRV: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| rust: [1.88.0] | |
| name: Check / Test MSRV on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install rust ${{ matrix.rust }} toolchain | |
| run: | | |
| rustup toolchain install ${{ matrix.rust }} --profile minimal --no-self-update | |
| rustup default ${{ matrix.rust }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check sentry-core without default features | |
| run: cargo check --no-default-features | |
| working-directory: sentry-core | |
| - name: Check default features | |
| run: cargo check | |
| - name: Test sentry test feature | |
| run: cargo test --features=test | |
| working-directory: sentry | |
| 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 | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| files: lcov.info | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| doc: | |
| name: Build-test documentation | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTDOCFLAGS: -Dwarnings | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - run: rustup component add rust-docs | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo doc | |
| run: cargo doc --workspace --all-features --document-private-items --no-deps |