| 1 |
name: Rust |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master ] |
| 6 |
pull_request: |
| 7 |
branches: [ master ] |
| 8 |
|
| 9 |
env: |
| 10 |
CARGO_TERM_COLOR: always |
| 11 |
|
| 12 |
permissions: read-all |
| 13 |
|
| 14 |
jobs: |
| 15 |
test: |
| 16 |
runs-on: ubuntu-latest |
| 17 |
strategy: |
| 18 |
fail-fast: false |
| 19 |
matrix: |
| 20 |
rust: [stable, beta, nightly] |
| 21 |
|
| 22 |
steps: |
| 23 |
- uses: actions/checkout@v3 |
| 24 |
- name: Install Rust |
| 25 |
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} |
| 26 |
- name: Run Tests |
| 27 |
run: cargo test --verbose |
| 28 |
- name: Build crate |
| 29 |
run: cargo build --all --all-features --all-targets |
| 30 |
- name: Catch missing feature flags |
| 31 |
if: startsWith(matrix.rust, 'nightly') |
| 32 |
run: cargo check -Z features=dev_dep |
| 33 |
- name: Install cargo-hack |
| 34 |
uses: taiki-e/install-action@cargo-hack |
| 35 |
- run: rustup target add thumbv7m-none-eabi |
| 36 |
- name: Ensure we don't depend on libstd |
| 37 |
run: cargo hack build --target thumbv7m-none-eabi --no-dev-deps --no-default-features |
| 38 |
|
| 39 |
semver: |
| 40 |
runs-on: ubuntu-latest |
| 41 |
steps: |
| 42 |
- name: Checkout |
| 43 |
uses: actions/checkout@v4 |
| 44 |
- name: Check semver |
| 45 |
uses: obi1kenobi/cargo-semver-checks-action@v2 |
| 46 |
|
| 47 |
msrv: |
| 48 |
runs-on: ubuntu-latest |
| 49 |
strategy: |
| 50 |
matrix: |
| 51 |
version: [1.60.0] |
| 52 |
steps: |
| 53 |
- uses: actions/checkout@v3 |
| 54 |
- name: Install Rust |
| 55 |
run: rustup update ${{ matrix.version }} && rustup default ${{ matrix.version }} |
| 56 |
- name: Check MSRV |
| 57 |
run: cargo check --all --all-features |
| 58 |
|
| 59 |
miri: |
| 60 |
runs-on: ubuntu-latest |
| 61 |
steps: |
| 62 |
- uses: actions/checkout@v3 |
| 63 |
- name: Install Rust |
| 64 |
run: rustup toolchain install nightly --component miri && rustup default nightly |
| 65 |
- run: cargo miri test |
| 66 |
env: |
| 67 |
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation -Zmiri-ignore-leaks |
| 68 |
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout |