-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (76 loc) · 2.71 KB
/
Copy pathci.yml
File metadata and controls
84 lines (76 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
check:
name: fmt, clippy, test, docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 # master
with:
toolchain: stable
components: rustfmt, clippy
- name: Formatting
run: cargo fmt --check
- name: Clippy (all features)
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Clippy (no_std)
run: cargo clippy --no-default-features -- -D warnings
- name: Test
run: cargo test --all-features
- name: Docs
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: "-D warnings"
no-std:
name: no_std build (bare metal)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 # master
with:
toolchain: stable
targets: thumbv7em-none-eabihf
- name: Build for a no_std target
run: cargo build --no-default-features --target thumbv7em-none-eabihf
msrv:
name: minimum supported Rust (1.85)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 # master
with:
toolchain: "1.85.0"
- run: cargo build --all-features
conformance:
name: Conformance vectors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: dtolnay/rust-toolchain@fa04a1451ff1842e2626ccb99004d0195b455a88 # master
with:
toolchain: stable
- name: Download shared conformance vectors
run: |
base=https://raw.githubusercontent.com/firechip/cobs-conformance/v1.1.0/vectors
curl -sSfL -o vectors.jsonl "$base/vectors.jsonl"
curl -sSfL -o sentinel.jsonl "$base/sentinel.jsonl"
curl -sSfL -o errors.jsonl "$base/errors.jsonl"
- name: Check conformance
env:
COBS_CONFORMANCE_VECTORS: ${{ github.workspace }}/vectors.jsonl
COBS_CONFORMANCE_SENTINEL: ${{ github.workspace }}/sentinel.jsonl
COBS_CONFORMANCE_ERRORS: ${{ github.workspace }}/errors.jsonl
run: cargo test --test conformance --all-features -- --nocapture