| 1 | --- |
| 2 | name: CI |
| 3 | |
| 4 | "on": |
| 5 | pull_request: |
| 6 | types: [opened, synchronize, reopened] |
| 7 | push: |
| 8 | branches: [main] |
| 9 | |
| 10 | jobs: |
| 11 | build_and_test: |
| 12 | strategy: |
| 13 | fail-fast: false |
| 14 | matrix: |
| 15 | version: |
| 16 | - { name: msrv, version: '1.81' } |
| 17 | - { name: stable, version: stable } |
| 18 | - { name: nightly, version: nightly } |
| 19 | |
| 20 | name: ${{ matrix.version.name }} |
| 21 | runs-on: ubuntu-latest |
| 22 | |
| 23 | steps: |
| 24 | - uses: actions/checkout@v4 |
| 25 | |
| 26 | - name: Install Rust |
| 27 | uses: actions-rust-lang/[email protected] |
| 28 | with: |
| 29 | toolchain: ${{ matrix.version.version }} |
| 30 | |
| 31 | - name: cargo check |
| 32 | run: cargo check --workspace --bins --examples --tests |
| 33 | |
| 34 | - name: cargo test |
| 35 | run: | |
| 36 | cargo test --workspace --all-features --no-fail-fast -- --nocapture |
| 37 | cargo build --features=unsealed_read_write |
| 38 | cargo build --no-default-features --features=unsealed_read_write |
| 39 | |
| 40 | build_and_test_no_std: |
| 41 | name: stable (no_std) |
| 42 | runs-on: ubuntu-latest |
| 43 | |
| 44 | steps: |
| 45 | - uses: actions/checkout@v4 |
| 46 | |
| 47 | - name: Install Rust |
| 48 | uses: actions-rust-lang/[email protected] |
| 49 | |
| 50 | - name: Add no_std target |
| 51 | run: rustup target add thumbv7em-none-eabihf |
| 52 | |
| 53 | - name: cargo test |
| 54 | run: | |
| 55 | cargo build --target thumbv7em-none-eabihf --no-default-features --features=alloc |
| 56 | cargo test --no-default-features --lib --tests |
| 57 | cargo build --no-default-features --features=alloc |