72
72
with :
73
73
profile : minimal
74
74
toolchain : stable
75
- components : clippy, rustfmt
76
75
override : true
77
76
78
77
- uses : actions/cache@v3
@@ -93,36 +92,12 @@ jobs:
93
92
shell : bash
94
93
run : |
95
94
cargo install cargo2junit 2>/dev/null || true # Suppress the "binary `xyz` already exists in destination" error
96
- cargo install cargo-sort 2>/dev/null || true
97
95
98
96
- name : Cargo build
99
97
uses : actions-rs/cargo@v1
100
98
with :
101
99
command : build
102
100
args : --release --all-targets --features portable -p ${{ env.CARGO_PROJECT_NAME }}
103
-
104
- - name : Cargo check
105
- uses : actions-rs/cargo@v1
106
- with :
107
- command : check
108
- args : --release --all-targets -p ${{ env.CARGO_PROJECT_NAME }}
109
-
110
- - name : Clippy Check
111
- uses : actions-rs/clippy-check@v1
112
- with :
113
- name : clippy-${{ matrix.project }}
114
- token : ${{ secrets.GITHUB_TOKEN }}
115
- args : --release --all-features --all-targets --no-deps -p ${{ env.CARGO_PROJECT_NAME }} -- -D warnings
116
-
117
- - name : Cargo fmt
118
- uses : actions-rs/cargo@v1
119
- with :
120
- command : fmt
121
- args : --check -p ${{ env.CARGO_PROJECT_NAME }}
122
-
123
- - name : Cargo sort
124
- run : |
125
- cargo sort -c ${{ matrix.project }}/Cargo.toml
126
101
127
102
- name : Run tests
128
103
if : ${{ matrix.skip_tests != true }}
@@ -148,6 +123,54 @@ jobs:
148
123
path : |
149
124
target/release/${{ env.ARTIFACTS_PATTERN }}*
150
125
if-no-files-found : error
126
+
127
+ check :
128
+ runs-on : ubuntu-22.04
129
+ steps :
130
+ - name : Checkout sources
131
+ uses : actions/checkout@v3
132
+
133
+ - name : Install stable toolchain
134
+ uses : actions-rs/toolchain@v1
135
+ with :
136
+ profile : minimal
137
+ toolchain : stable
138
+ components : clippy, rustfmt
139
+ override : true
140
+
141
+ - name : Rust Cache
142
+
143
+ with :
144
+ key : ${{ runner.os }}-cache-v${{ secrets.CACHE_VERSION }}
145
+
146
+ - name : Install cargo tools
147
+ if : ${{ steps.cargo-cache.outputs.cache-hit == false }}
148
+ shell : bash
149
+ run : |
150
+ cargo install cargo-sort 2>/dev/null || true # Suppress the "binary `xyz` already exists in destination" error
151
+
152
+ - name : Cargo check
153
+ uses : actions-rs/cargo@v1
154
+ with :
155
+ command : check
156
+ args : --release --all-targets
157
+
158
+ - name : Clippy Check
159
+ uses : actions-rs/clippy-check@v1
160
+ with :
161
+ name : clippy
162
+ token : ${{ secrets.GITHUB_TOKEN }}
163
+ args : --all-features --all-targets --no-deps -- -D warnings
164
+
165
+ - name : Cargo fmt
166
+ uses : actions-rs/cargo@v1
167
+ with :
168
+ command : fmt
169
+ args : --check
170
+
171
+ - name : Cargo sort
172
+ shell : bash
173
+ run : cargo sort -w -c
151
174
152
175
test-mithril-core :
153
176
runs-on : ubuntu-22.04
@@ -162,7 +185,6 @@ jobs:
162
185
with :
163
186
profile : minimal
164
187
toolchain : stable
165
- components : clippy, rustfmt
166
188
override : true
167
189
168
190
# Get the matrix build cache for mithril-core
@@ -333,6 +355,7 @@ jobs:
333
355
runs-on : ubuntu-22.04
334
356
if : ${{ github.event_name == 'push' }}
335
357
needs :
358
+ - check
336
359
- test-mithril-core
337
360
- run-test-lab
338
361
strategy :
@@ -392,6 +415,7 @@ jobs:
392
415
needs :
393
416
- test-mithril-core
394
417
- run-test-lab
418
+ - check
395
419
steps :
396
420
- name : Download mithril-core lib
397
421
uses : actions/download-artifact@v3
0 commit comments