|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +env: |
| 17 | + CARGO_TERM_COLOR: always |
| 18 | + RUSTFLAGS: "-D warnings" |
| 19 | + |
| 20 | +jobs: |
| 21 | + check: |
| 22 | + name: fmt, clippy, test, docs |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - uses: dtolnay/rust-toolchain@stable |
| 27 | + with: |
| 28 | + components: rustfmt, clippy |
| 29 | + - name: Formatting |
| 30 | + run: cargo fmt --check |
| 31 | + - name: Clippy (all features) |
| 32 | + run: cargo clippy --all-targets --all-features -- -D warnings |
| 33 | + - name: Clippy (no_std) |
| 34 | + run: cargo clippy --no-default-features -- -D warnings |
| 35 | + - name: Test |
| 36 | + run: cargo test --all-features |
| 37 | + - name: Docs |
| 38 | + run: cargo doc --no-deps --all-features |
| 39 | + env: |
| 40 | + RUSTDOCFLAGS: "-D warnings" |
| 41 | + |
| 42 | + no-std: |
| 43 | + name: no_std build (bare metal) |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + - uses: dtolnay/rust-toolchain@stable |
| 48 | + with: |
| 49 | + targets: thumbv7em-none-eabihf |
| 50 | + - name: Build for a no_std target |
| 51 | + run: cargo build --no-default-features --target thumbv7em-none-eabihf |
| 52 | + |
| 53 | + msrv: |
| 54 | + name: minimum supported Rust (1.81) |
| 55 | + runs-on: ubuntu-latest |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + - uses: dtolnay/rust-toolchain@1.81.0 |
| 59 | + - run: cargo build --all-features |
| 60 | + |
| 61 | + conformance: |
| 62 | + name: Conformance vectors |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + - uses: dtolnay/rust-toolchain@stable |
| 67 | + - name: Download shared conformance vectors |
| 68 | + run: curl -sSfL -o vectors.jsonl https://raw.githubusercontent.com/firechip/cobs-conformance/v1.0.0/vectors/vectors.jsonl |
| 69 | + - name: Check conformance |
| 70 | + env: |
| 71 | + COBS_CONFORMANCE_VECTORS: ${{ github.workspace }}/vectors.jsonl |
| 72 | + run: cargo test --test conformance -- --nocapture |
0 commit comments