Ci improvements #4
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
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main, kernel] | |
| pull_request: | |
| name: CI | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --check | |
| - run: cd internal && cargo fmt --check | |
| readme: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - run: cargo install cargo-rdme | |
| - run: cargo rdme --check | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rust-src | |
| - run: cargo doc --no-deps | |
| - run: cd internal && cargo doc --no-deps --locked | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy | |
| - run: cargo install cargo-hack | |
| - run: cargo hack --clean-per-run --feature-powerset clippy --locked | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - run: cargo install cargo-expand | |
| - run: cargo test --locked | |
| miri: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| flags: [ | |
| "", | |
| "-Zmiri-tree-borrows", | |
| "-Zmiri-strict-provenance", | |
| "-Zmiri-tree-borrows -Zmiri-strict-provenance", | |
| ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV | |
| - name: Install ${{env.NIGHTLY}} | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{env.NIGHTLY}} | |
| components: miri | |
| - run: cargo install cargo-expand | |
| - name: ${{matrix.flags}} cargo miri test | |
| run: cargo miri test --locked | |
| env: | |
| MIRIFLAGS: ${{matrix.flags}} | |
| sanitizers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - name: enable debug symbols | |
| run: | | |
| sudo apt install llvm | |
| # https://github.com/japaric/rust-san#unrealiable-leaksanitizer | |
| sed -i '/\[features\]/i [profile.dev]' Cargo.toml | |
| sed -i '/profile.dev/a opt-level = 1' Cargo.toml | |
| cat Cargo.toml | |
| - run: cargo test --lib --tests | |
| env: | |
| ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" | |
| RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=address" | |
| - run: cargo test | |
| env: | |
| RUSTFLAGS: "--cfg NO_UI_TESTS --cfg NO_ALLOC_FAIL_TESTS -Z sanitizer=leak" | |
| stable: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo install cargo-hack | |
| - run: cargo hack check \ | |
| --clean-per-run \ | |
| --feature-powerset \ | |
| --exclude--features alloc \ | |
| --version-range 1.82.. \ | |
| --clean-per-version \ | |
| --locked | |
| nightly-msrv: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo install cargo-hack | |
| - run: cargo install cargo-expand | |
| - run: cargo hack check \ | |
| --clean-per-run \ | |
| --feature-powerset \ | |
| --version-range 1.78.. \ | |
| --clean-per-version \ | |
| --locked | |
| env: | |
| RUSTC_BOOTSTRAP: 1 | |
| - run: cargo clean | |
| - run: cargo hack test \ | |
| --clean-per-run \ | |
| --version-range 1.78.. \ | |
| --clean-per-version \ | |
| --locked | |
| env: | |
| RUSTC_BOOTSTRAP: 1 | |
| os-check: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, windows-latest] | |
| runs-on: ${{matrix.os}} | |
| name: os-check (${{matrix.os}}) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - run: cargo install cargo-expand | |
| - run: cargo test --locked |