11# This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs
22# several checks:
3- # - commit_list: produces a list of commits to be checked
43# - fmt: checks that the code is formatted according to rustfmt
54# - clippy: checks that the code does not contain any clippy warnings
65# - doc: checks that the code can be documented without errors
@@ -23,26 +22,13 @@ concurrency:
2322name : check
2423jobs :
2524
26- commit_list :
27- uses : ./.github/workflows/commit-list.yml
28- with :
29- event_name : ${{ github.event_name }}
30- base_ref : ${{ github.base_ref }}
31- head_sha : ${{ github.event.pull_request.head.sha || github.sha }}
32-
3325 fmt :
3426 runs-on : ubuntu-latest
3527 name : stable / fmt
36- needs : commit_list
37- strategy :
38- fail-fast : false
39- matrix :
40- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
4128 steps :
4229 - uses : actions/checkout@v4
4330 with :
4431 submodules : true
45- ref : ${{ matrix.commit }}
4632 - name : Install stable
4733 uses : dtolnay/rust-toolchain@stable
4834 with :
5339 clippy :
5440 runs-on : ubuntu-latest
5541 name : ${{ matrix.toolchain }} / clippy
56- needs : commit_list
5742 permissions :
5843 contents : read
5944 checks : write
@@ -62,12 +47,10 @@ jobs:
6247 matrix :
6348 # Get early warning of new lints which are regularly introduced in beta channels.
6449 toolchain : [stable, beta]
65- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
6650 steps :
6751 - uses : actions/checkout@v4
6852 with :
6953 submodules : true
70- ref : ${{ matrix.commit }}
7154 - name : Install ${{ matrix.toolchain }}
7255 uses : dtolnay/rust-toolchain@master
7356 with :
@@ -83,16 +66,10 @@ jobs:
8366 # semver:
8467 # runs-on: ubuntu-latest
8568 # name: semver
86- # needs: commit_list
87- # strategy:
88- # fail-fast: false
89- # matrix:
90- # commit: ${{ fromJSON(needs.commit_list.outputs.commits) }}
9169 # steps:
9270 # - uses: actions/checkout@v4
9371 # with:
9472 # submodules: true
95- # ref: ${{ matrix.commit }}
9673 # - name: Install stable
9774 # uses: dtolnay/rust-toolchain@stable
9875 # with:
@@ -106,16 +83,10 @@ jobs:
10683 # API be documented as only available in some specific platforms.
10784 runs-on : ubuntu-latest
10885 name : nightly / doc
109- needs : commit_list
110- strategy :
111- fail-fast : false
112- matrix :
113- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
11486 steps :
11587 - uses : actions/checkout@v4
11688 with :
11789 submodules : true
118- ref : ${{ matrix.commit }}
11990 - name : Install nightly
12091 uses : dtolnay/rust-toolchain@nightly
12192 - name : cargo doc
@@ -130,16 +101,12 @@ jobs:
130101 # which is required for feature unification
131102 runs-on : ubuntu-latest
132103 name : ubuntu / stable / features
133- needs : commit_list
134104 strategy :
135105 fail-fast : false
136- matrix :
137- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
138106 steps :
139107 - uses : actions/checkout@v4
140108 with :
141109 submodules : true
142- ref : ${{ matrix.commit }}
143110 - name : Install stable
144111 uses : dtolnay/rust-toolchain@stable
145112 - name : cargo install cargo-hack
@@ -154,16 +121,10 @@ jobs:
154121 # our dependencies.
155122 runs-on : ubuntu-latest
156123 name : ubuntu / stable / deny
157- needs : commit_list
158- strategy :
159- fail-fast : false
160- matrix :
161- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
162124 steps :
163125 - uses : actions/checkout@v4
164126 with :
165127 submodules : true
166- ref : ${{ matrix.commit }}
167128 - name : Install stable
168129 uses : dtolnay/rust-toolchain@stable
169130 - name : cargo install cargo-deny
@@ -176,16 +137,10 @@ jobs:
176137 test :
177138 runs-on : ubuntu-latest
178139 name : ubuntu / stable / test
179- needs : commit_list
180- strategy :
181- fail-fast : false
182- matrix :
183- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
184140 steps :
185141 - uses : actions/checkout@v4
186142 with :
187143 submodules : true
188- ref : ${{ matrix.commit }}
189144 - name : Install stable
190145 uses : dtolnay/rust-toolchain@stable
191146 - name : cargo test
@@ -194,20 +149,17 @@ jobs:
194149 msrv :
195150 # check that we can build using the minimal rust version that is specified by this crate
196151 runs-on : ubuntu-latest
197- needs : commit_list
198152 # we use a matrix here just because env can't be used in job names
199153 # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
200154 strategy :
201155 fail-fast : false
202156 matrix :
203- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
204157 msrv : ["1.85"]
205158 name : ubuntu / ${{ matrix.msrv }}
206159 steps :
207160 - uses : actions/checkout@v4
208161 with :
209162 submodules : true
210- ref : ${{ matrix.commit }}
211163 - name : Install ${{ matrix.msrv }}
212164 uses : dtolnay/rust-toolchain@master
213165 with :
@@ -220,20 +172,17 @@ jobs:
220172
221173 check-arm-examples :
222174 runs-on : ubuntu-latest
223- needs : commit_list
224175 # we use a matrix here just because env can't be used in job names
225176 # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
226177 strategy :
227178 fail-fast : false
228179 matrix :
229- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
230180 example_directory : ["examples/rt633", "examples/rt685s-evk"]
231181 name : ubuntu / check-examples
232182 steps :
233183 - uses : actions/checkout@v4
234184 with :
235185 submodules : true
236- ref : ${{ matrix.commit }}
237186 - name : Install stable
238187 uses : dtolnay/rust-toolchain@stable
239188 - name : cargo check
@@ -243,20 +192,17 @@ jobs:
243192
244193 check-std-examples :
245194 runs-on : ubuntu-latest
246- needs : commit_list
247195 # we use a matrix here just because env can't be used in job names
248196 # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
249197 strategy :
250198 fail-fast : false
251199 matrix :
252- commit : ${{ fromJSON(needs.commit_list.outputs.commits) }}
253200 example_directory : ["examples/std"]
254201 name : ubuntu / check-examples
255202 steps :
256203 - uses : actions/checkout@v4
257204 with :
258205 submodules : true
259- ref : ${{ matrix.commit }}
260206 - name : Install stable
261207 uses : dtolnay/rust-toolchain@stable
262208 - name : cargo check
0 commit comments