64
64
- run : yarn build
65
65
continue-on-error : true
66
66
67
+ backend-lint :
68
+ name : Backend (linting)
69
+ runs-on : ubuntu-18.04
70
+
71
+ steps :
72
+ - uses : actions/checkout@v2
73
+
74
+ # Current size as of 2021-02-15: ~105 MB
75
+ - name : Cache cargo registry and git deps
76
+ uses : actions/cache@v2.1.4
77
+ with :
78
+ path : |
79
+ ~/.cargo/registry/cache
80
+ ~/.cargo/registry/index
81
+ ~/.cargo/git/db
82
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
83
+ restore-keys : |
84
+ ${{ runner.os }}-cargo-
85
+
86
+ - id : rustc
87
+ run :
88
+ echo "::set-output name=version::$(rustc -V)"
89
+
90
+ - name : Cache cargo build
91
+ uses : actions/cache@v2.1.4
92
+ with :
93
+ path : target
94
+ key : v2-${{ runner.os }}-cargo-clippy-${{ steps.rustc.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
95
+ restore-keys : |
96
+ v2-${{ runner.os }}-cargo-clippy-${{ steps.rustc.outputs.version }}-
97
+
98
+ - name : Install Rust
99
+ run : |
100
+ rustup set profile minimal
101
+ rustup update stable
102
+ rustup default stable
103
+
104
+ - run : rustup component add rustfmt
105
+ - run : rustup component add clippy
106
+
107
+ - run : cargo fmt -- --check
108
+ - run : cargo clippy --all-targets --all-features --all
109
+
67
110
backend :
68
111
name : Backend
69
112
runs-on : ubuntu-18.04
@@ -146,12 +189,6 @@ jobs:
146
189
rustup update ${{ matrix.rust }}
147
190
rustup default ${{ matrix.rust }}
148
191
149
- - name : Install lint tools
150
- if : matrix.rust == 'stable'
151
- run : |
152
- rustup component add rustfmt
153
- rustup component add clippy
154
-
155
192
- id : rustc
156
193
run :
157
194
echo "::set-output name=version::$(rustc -V)"
@@ -170,12 +207,6 @@ jobs:
170
207
which diesel || cargo install diesel_cli --vers $(cat .diesel_version) --no-default-features --features postgres --debug
171
208
diesel database setup --locked-schema
172
209
173
- - name : Lint
174
- if : matrix.rust == 'stable'
175
- run : |
176
- cargo fmt -- --check
177
- cargo clippy --all-targets --all-features --all
178
-
179
210
- name : Install cargo-tarpaulin
180
211
if : matrix.rust == 'stable'
181
212
run : which cargo-tarpaulin || cargo install cargo-tarpaulin
@@ -202,7 +233,7 @@ jobs:
202
233
name : bors build finished
203
234
if : success()
204
235
runs-on : ubuntu-latest
205
- needs : [frontend, backend]
236
+ needs : [frontend, backend, backend-lint ]
206
237
207
238
steps :
208
239
- name : Mark the job as successful
@@ -212,7 +243,7 @@ jobs:
212
243
name : bors build finished
213
244
if : " !success()"
214
245
runs-on : ubuntu-latest
215
- needs : [frontend, backend]
246
+ needs : [frontend, backend, backend-lint ]
216
247
217
248
steps :
218
249
- name : Mark the job as a failure
0 commit comments