• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2permissions:
3  contents: read
4on:
5  pull_request:
6    paths-ignore:
7      - README.md
8  push:
9    branches: main
10    paths-ignore:
11      - README.md
12
13jobs:
14  build:
15    runs-on: ubuntu-latest
16    strategy:
17      matrix:
18        rust:
19          - stable
20          - beta
21          - nightly-2023-04-01
22    steps:
23      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
24      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
25        with:
26          toolchain: ${{ matrix.rust }}
27          components: rustfmt
28      - run: cargo +${{ matrix.rust }} build --release --workspace
29      - run: cargo +${{ matrix.rust }} build --release --workspace --features=std
30
31  test:
32    runs-on: ubuntu-latest
33    strategy:
34      matrix:
35        rust:
36          - stable
37          - beta
38          - nightly-2023-04-01
39    steps:
40      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
41        with:
42          submodules: true
43      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
44        with:
45          toolchain: ${{ matrix.rust }}
46          components: rustfmt
47      - run: cargo +${{ matrix.rust }} test --workspace -- --nocapture
48      - run: cargo +${{ matrix.rust }} test --workspace --features=std -- --nocapture
49
50  examples:
51    runs-on: ubuntu-latest
52    strategy:
53      matrix:
54        rust:
55          - stable
56          - beta
57          - nightly-2023-04-01
58    steps:
59      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
60        with:
61          submodules: true
62      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
63        with:
64          toolchain: ${{ matrix.rust }}
65          components: rustfmt
66      - run: cargo +${{ matrix.rust }} test --examples
67      - run: cargo +${{ matrix.rust }} test --features=std --examples
68
69  no_std:
70    name: Build for a no_std target
71    runs-on: ubuntu-latest
72    strategy:
73      matrix:
74        rust:
75          - stable
76          - beta
77          - nightly-2023-04-01
78    steps:
79      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
80      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
81        with:
82          toolchain: ${{ matrix.rust }}
83          components: rustfmt
84          targets: thumbv6m-none-eabi
85      - run: cargo +${{ matrix.rust }} build --release --workspace --target thumbv6m-none-eabi
86
87  msrv:
88    name: Rust ${{matrix.rust}} MSRV
89    runs-on: ubuntu-latest
90    strategy:
91      fail-fast: false
92      matrix:
93        rust: [1.58.0, 1.59.0]
94    steps:
95      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
96        with:
97          submodules: true
98      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
99        with:
100          toolchain: ${{ matrix.rust }}
101          components: rustfmt
102      - run: rustc --version
103      - run: cargo +${{ matrix.rust }} build --release --workspace
104      - run: cargo +${{ matrix.rust }} build --release --workspace --all-features
105
106  formatting:
107    runs-on: ubuntu-latest
108    steps:
109      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
110      - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
111      - run: go install github.com/campoy/embedmd@97c13d6
112      - uses: ruby/setup-ruby@d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c # v1.148.0
113        with:
114          ruby-version: '2.7'
115      - run: gem install mdl
116      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
117        with:
118          toolchain: nightly-2023-04-01
119          components: rustfmt
120      - run: cargo +nightly-2023-04-01 fmt --all -- --check
121      - run: scripts/check-format.sh
122
123  clippy:
124    runs-on: ubuntu-latest
125    steps:
126      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
127      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
128        with:
129          toolchain: stable
130          components: rustfmt, clippy
131      - run: cargo +stable clippy --all-features --all-targets -- -Dwarnings
132      - run: git diff --exit-code
133
134  doc:
135    runs-on: ubuntu-latest
136    steps:
137      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
138      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
139        with:
140          toolchain: stable
141      - run: RUSTDOCFLAGS="-Dwarnings" cargo doc --no-deps --document-private-items
142
143  udeps:
144    runs-on: ubuntu-latest
145    steps:
146      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
147      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
148        with:
149          toolchain: nightly-2023-04-01
150          components: rustfmt
151      - run: cargo +nightly-2023-04-01 install --locked --version 0.1.39 cargo-udeps
152      - run: cargo +nightly-2023-04-01 udeps
153
154  deny:
155    runs-on: ubuntu-latest
156    steps:
157      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
158      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
159        with:
160          toolchain: nightly-2023-04-01
161          components: rustfmt
162      - run: cargo +nightly-2023-04-01 install --locked --version 0.13.9 cargo-deny
163      - run: cargo deny check
164
165  coverage:
166    runs-on: ubuntu-latest
167    steps:
168      - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
169        with:
170          submodules: true
171          fetch-depth: 0
172      - uses: dtolnay/rust-toolchain@a3ac054b2e7d62f514aa1bd57e3508c522fe772d # 1.68.2
173        with:
174          toolchain: nightly-2024-04-01
175          components: rustfmt
176      - uses: actions-rs/install@69ec87709ffb5b19a7b5ddbf610cb221498bb1eb # v0.1.2
177        with:
178          crate: cargo-tarpaulin
179          version: 0.25.2
180          use-tool-cache: true
181      - run: cargo +nightly-2024-04-01 tarpaulin --verbose --ignore-tests --all-features --timeout=600 --out Xml
182      - name: Upload to codecov.io
183        run: |
184          bash <(curl -s https://codecov.io/bash)
185