1
1
name : CI
2
2
on :
3
3
push :
4
- branches-ignore : [master]
4
+ branches :
5
+ - auto-cargo
6
+ - try
7
+ - automation/bors/try
8
+ - " rust-**"
5
9
pull_request :
6
- branches : ['*']
10
+ branches :
11
+ - " **"
7
12
8
13
defaults :
9
14
run :
@@ -12,6 +17,10 @@ defaults:
12
17
permissions :
13
18
contents : read
14
19
20
+ concurrency :
21
+ group : " ${{ github.workflow }}-${{ (github.ref == 'refs/heads/try' && github.sha) || github.ref }}"
22
+ cancel-in-progress : true
23
+
15
24
jobs :
16
25
success :
17
26
permissions :
@@ -53,17 +62,23 @@ jobs:
53
62
# Check Code style quickly by running `rustfmt` over all code
54
63
rustfmt :
55
64
runs-on : ubuntu-latest
65
+ if : " github.repository == 'rust-lang/cargo'"
56
66
steps :
57
67
- uses : actions/checkout@v4
68
+ with :
69
+ fetch-depth : 2
58
70
- run : rustup update stable && rustup default stable
59
71
- run : rustup component add rustfmt
60
72
- run : cargo fmt --all --check
61
73
62
74
# Ensure there are no clippy warnings
63
75
clippy :
64
76
runs-on : ubuntu-latest
77
+ if : " github.repository == 'rust-lang/cargo'"
65
78
steps :
66
79
- uses : actions/checkout@v4
80
+ with :
81
+ fetch-depth : 2
67
82
- run : rustup update stable && rustup default stable
68
83
- run : rustup component add clippy
69
84
- run : cargo clippy --workspace --all-targets --no-deps -- -D warnings
@@ -72,19 +87,25 @@ jobs:
72
87
runs-on : ubuntu-latest
73
88
steps :
74
89
- uses : actions/checkout@v4
90
+ with :
91
+ fetch-depth : 2
75
92
- run : rustup update stable && rustup default stable
76
93
- run : cargo stale-label
77
94
78
95
# Ensure Cargo.lock is up-to-date
79
96
lockfile :
80
97
runs-on : ubuntu-latest
98
+ if : " github.repository == 'rust-lang/cargo'"
81
99
steps :
82
100
- uses : actions/checkout@v4
101
+ with :
102
+ fetch-depth : 2
83
103
- run : rustup update stable && rustup default stable
84
104
- run : cargo update -p cargo --locked
85
105
86
106
check-version-bump :
87
107
runs-on : ubuntu-latest
108
+ if : " github.repository == 'rust-lang/cargo'"
88
109
env :
89
110
BASE_SHA : ${{ github.event.pull_request.base.sha }}
90
111
HEAD_SHA : ${{ github.event.pull_request.head.sha != '' && github.event.pull_request.head.sha || github.sha }}
@@ -108,6 +129,7 @@ jobs:
108
129
CARGO_PROFILE_TEST_DEBUG : 1
109
130
CARGO_INCREMENTAL : 0
110
131
CARGO_PUBLIC_NETWORK_TESTS : 1
132
+ if : " github.repository == 'rust-lang/cargo'"
111
133
strategy :
112
134
matrix :
113
135
include :
@@ -142,6 +164,8 @@ jobs:
142
164
name : Tests ${{ matrix.name }}
143
165
steps :
144
166
- uses : actions/checkout@v4
167
+ with :
168
+ fetch-depth : 2
145
169
- name : Dump Environment
146
170
run : ci/dump-environment.sh
147
171
- run : rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
@@ -191,15 +215,21 @@ jobs:
191
215
192
216
resolver :
193
217
runs-on : ubuntu-latest
218
+ if : " github.repository == 'rust-lang/cargo'"
194
219
steps :
195
220
- uses : actions/checkout@v4
221
+ with :
222
+ fetch-depth : 2
196
223
- run : rustup update stable && rustup default stable
197
224
- run : cargo test -p resolver-tests
198
225
199
226
test_gitoxide :
200
227
runs-on : ubuntu-latest
228
+ if : " github.repository == 'rust-lang/cargo'"
201
229
steps :
202
230
- uses : actions/checkout@v4
231
+ with :
232
+ fetch-depth : 2
203
233
- run : rustup update --no-self-update stable && rustup default stable
204
234
- run : rustup target add i686-unknown-linux-gnu
205
235
- run : sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
@@ -210,8 +240,11 @@ jobs:
210
240
211
241
build_std :
212
242
runs-on : ubuntu-latest
243
+ if : " github.repository == 'rust-lang/cargo'"
213
244
steps :
214
245
- uses : actions/checkout@v4
246
+ with :
247
+ fetch-depth : 2
215
248
- run : rustup update nightly && rustup default nightly
216
249
- run : rustup component add rust-src
217
250
- run : cargo build
@@ -220,8 +253,11 @@ jobs:
220
253
CARGO_RUN_BUILD_STD_TESTS : 1
221
254
docs :
222
255
runs-on : ubuntu-latest
256
+ if : " github.repository == 'rust-lang/cargo'"
223
257
steps :
224
258
- uses : actions/checkout@v4
259
+ with :
260
+ fetch-depth : 2
225
261
- run : rustup update nightly && rustup default nightly
226
262
- run : rustup update stable
227
263
- run : rustup component add rust-docs
@@ -247,7 +283,10 @@ jobs:
247
283
248
284
msrv :
249
285
runs-on : ubuntu-latest
286
+ if : " github.repository == 'rust-lang/cargo'"
250
287
steps :
251
288
- uses : actions/checkout@v4
289
+ with :
290
+ fetch-depth : 2
252
291
- uses : taiki-e/install-action@cargo-hack
253
292
- run : cargo hack check --all-targets --rust-version --workspace --ignore-private
0 commit comments