29
29
# The expand-yaml-anchors tool will automatically remove this block from the
30
30
# output YAML file.
31
31
x--expand-yaml-anchors--remove :
32
- - &shared-ci-variables
33
- CI_JOB_NAME : ${{ matrix.name }}
34
- CARGO_REGISTRIES_CRATES_IO_PROTOCOL : sparse
35
- # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
36
- HEAD_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
37
- DOCKER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
38
-
39
- - &public-variables
40
- SCCACHE_BUCKET : rust-lang-ci-sccache2
41
- TOOLSTATE_REPO : https://github.com/rust-lang-nursery/rust-toolstate
42
- CACHE_DOMAIN : ci-caches.rust-lang.org
43
-
44
- - &prod-variables
45
- SCCACHE_BUCKET : rust-lang-ci-sccache2
46
- DEPLOY_BUCKET : rust-lang-ci2
47
- TOOLSTATE_REPO : https://github.com/rust-lang-nursery/rust-toolstate
48
- TOOLSTATE_ISSUES_API_URL : https://api.github.com/repos/rust-lang/rust/issues
49
- TOOLSTATE_PUBLISH : 1
50
- # AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named
51
- # AWS_SECRET_ACCESS_KEY_<keyid>. Including the key id in the name allows to
52
- # rotate them in a single branch while keeping the old key in another
53
- # branch, which wouldn't be possible if the key was named with the kind
54
- # (caches, artifacts...).
55
- CACHES_AWS_ACCESS_KEY_ID : AKIA46X5W6CZI5DHEBFL
56
- ARTIFACTS_AWS_ACCESS_KEY_ID : AKIA46X5W6CZN24CBO55
57
- AWS_REGION : us-west-1
58
- CACHE_DOMAIN : ci-caches.rust-lang.org
59
-
60
- - &dummy-variables
61
- SCCACHE_BUCKET : rust-lang-gha-caches
62
- DEPLOY_BUCKET : rust-lang-gha
63
- TOOLSTATE_REPO : https://github.com/pietroalbini/rust-toolstate
64
- TOOLSTATE_ISSUES_API_URL : https://api.github.com/repos/pietroalbini/rust-toolstate/issues
65
- TOOLSTATE_PUBLISH : 1
66
- # AWS_SECRET_ACCESS_KEYs are stored in GitHub's secrets storage, named
67
- # AWS_SECRET_ACCESS_KEY_<keyid>. Including the key id in the name allows to
68
- # rotate them in a single branch while keeping the old key in another
69
- # branch, which wouldn't be possible if the key was named with the kind
70
- # (caches, artifacts...).
71
- CACHES_AWS_ACCESS_KEY_ID : AKIA46X5W6CZOMUQATD5
72
- ARTIFACTS_AWS_ACCESS_KEY_ID : AKIA46X5W6CZH5AYXDVF
73
- AWS_REGION : us-west-1
74
- CACHE_DOMAIN : ci-caches-gha.rust-lang.org
75
-
76
- - &base-job
77
- env : {}
78
-
79
- - &job-linux-4c
80
- os : ubuntu-20.04-4core-16gb
81
- << : *base-job
82
-
83
- - &job-linux-8c
84
- os : ubuntu-20.04-8core-32gb
85
- << : *base-job
86
-
87
- - &job-linux-16c
88
- os : ubuntu-20.04-16core-64gb
89
- << : *base-job
90
-
91
- - &job-macos-xl
92
- os : macos-13 # We use the standard runner for now
93
- << : *base-job
94
-
95
- - &job-macos-m1
96
- os : macos-14
97
- << : *base-job
98
-
99
- - &job-windows-8c
100
- os : windows-2019-8core-32gb
101
- << : *base-job
102
-
103
- - &job-windows-16c
104
- os : windows-2019-16core-64gb
105
- << : *base-job
106
-
107
- - &job-aarch64-linux
108
- os : [self-hosted, ARM64, linux]
109
-
110
- - &base-ci-job
32
+ # These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.
33
+ # Check out their documentation for more information on why they're needed.
34
+
35
+ - &base-outcome-job
36
+ name : bors build finished
37
+ runs-on : ubuntu-latest
38
+
39
+ - &base-success-job
40
+ steps :
41
+ - name : mark the job as a success
42
+ run : exit 0
43
+ shell : bash
44
+ << : *base-outcome-job
45
+
46
+ - &base-failure-job
47
+ steps :
48
+ - name : mark the job as a failure
49
+ run : exit 1
50
+ shell : bash
51
+ << : *base-outcome-job
52
+
53
+ # ##########################
54
+ # Builders definition #
55
+ # ##########################
56
+
57
+ name : CI
58
+ on :
59
+ push :
60
+ branches :
61
+ - auto
62
+ - try
63
+ - try-perf
64
+ - automation/bors/try
65
+ pull_request :
66
+ branches :
67
+ - " **"
68
+
69
+ permissions :
70
+ contents : read
71
+ packages : write
72
+
73
+ defaults :
74
+ run :
75
+ # On Linux, macOS, and Windows, use the system-provided bash as the default
76
+ # shell. (This should only make a difference on Windows, where the default
77
+ # shell is PowerShell.)
78
+ shell : bash
79
+
80
+ concurrency :
81
+ # For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
82
+ # We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
83
+ # are all triggered on the same branch, but which should be able to run concurrently.
84
+ group : ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}
85
+ cancel-in-progress : true
86
+
87
+ env :
88
+ TOOLSTATE_REPO : https://github.com/rust-lang-nursery/rust-toolstate
89
+
90
+ jobs :
91
+ # The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml.
92
+ # It calculates which jobs should be executed, based on the data of the ${{ github }} context.
93
+ # If you want to modify CI jobs, take a look at src/ci/github-actions/jobs.yml.
94
+ calculate_matrix :
95
+ name : Calculate job matrix
96
+ runs-on : ubuntu-latest
97
+ outputs :
98
+ jobs : ${{ steps.jobs.outputs.jobs }}
99
+ steps :
100
+ - name : Checkout the source code
101
+ uses : actions/checkout@v4
102
+ - name : Calculate the CI job matrix
103
+ run : python3 src/ci/github-actions/calculate-job-matrix.py >> $GITHUB_OUTPUT
104
+ id : jobs
105
+ job :
106
+ name : ${{ matrix.name }}
107
+ needs : [ calculate_matrix ]
108
+ runs-on : " ${{ matrix.os }}"
111
109
defaults :
112
110
run :
113
111
shell : ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}
114
112
timeout-minutes : 600
115
- runs-on : " ${{ matrix.os }}"
116
- env : *shared-ci-variables
113
+ env :
114
+ CI_JOB_NAME : ${{ matrix.image }}
115
+ CARGO_REGISTRIES_CRATES_IO_PROTOCOL : sparse
116
+ # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
117
+ HEAD_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
118
+ DOCKER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
119
+ SCCACHE_BUCKET : rust-lang-ci-sccache2
120
+ CACHE_DOMAIN : ci-caches.rust-lang.org
121
+ continue-on-error : ${{ matrix.continue_on_error || false }}
122
+ strategy :
123
+ matrix :
124
+ # Check the `calculate_matrix` job to see how is the matrix defined.
125
+ include : ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
126
+ # GitHub Actions fails the workflow if an empty list of jobs is provided to
127
+ # the workflow, so we need to skip this job if nothing was produced by
128
+ # the Python script.
129
+ #
130
+ # Unfortunately checking whether a list is empty is not possible in a nice
131
+ # way due to GitHub Actions expressions limits.
132
+ # This hack is taken from https://github.com/ferrocene/ferrocene/blob/d43edc6b7697cf1719ec1c17c54904ab94825763/.github/workflows/release.yml#L75-L82
133
+ if : fromJSON(needs.calculate_matrix.outputs.jobs)[0] != null
117
134
steps :
118
135
- if : contains(matrix.os, 'windows')
119
136
uses : msys2/setup-msys2@v2.22.0
@@ -253,122 +270,6 @@ x--expand-yaml-anchors--remove:
253
270
# erroring about invalid credentials instead.
254
271
if : success() && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')
255
272
256
- # These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.
257
- # Check out their documentation for more information on why they're needed.
258
-
259
- - &base-outcome-job
260
- name : bors build finished
261
- runs-on : ubuntu-latest
262
-
263
- - &base-success-job
264
- steps :
265
- - name : mark the job as a success
266
- run : exit 0
267
- shell : bash
268
- << : *base-outcome-job
269
-
270
- - &base-failure-job
271
- steps :
272
- - name : mark the job as a failure
273
- run : exit 1
274
- shell : bash
275
- << : *base-outcome-job
276
-
277
- # ##########################
278
- # Builders definition #
279
- # ##########################
280
-
281
- name : CI
282
- on :
283
- push :
284
- branches :
285
- - auto
286
- - try
287
- - try-perf
288
- - automation/bors/try
289
- - master
290
- pull_request :
291
- branches :
292
- - " **"
293
-
294
- permissions :
295
- contents : read
296
- packages : write
297
-
298
- defaults :
299
- run :
300
- # On Linux, macOS, and Windows, use the system-provided bash as the default
301
- # shell. (This should only make a difference on Windows, where the default
302
- # shell is PowerShell.)
303
- shell : bash
304
-
305
- concurrency :
306
- # For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
307
- # We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
308
- # are all triggered on the same branch, but which should be able to run concurrently.
309
- group : ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}
310
- cancel-in-progress : true
311
-
312
- jobs :
313
- # The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml.
314
- # It calculates which jobs should be executed, based on the data of the ${{ github }} context.
315
- # If you want to modify CI jobs, take a look at src/ci/github-actions/jobs.yml.
316
- calculate_matrix :
317
- name : Calculate job matrix
318
- runs-on : ubuntu-latest
319
- outputs :
320
- jobs : ${{ steps.jobs.outputs.jobs }}
321
- steps :
322
- - name : Checkout the source code
323
- uses : actions/checkout@v4
324
- - name : Calculate the CI job matrix
325
- run : python3 src/ci/github-actions/calculate-job-matrix.py >> $GITHUB_OUTPUT
326
- id : jobs
327
- job :
328
- << : *base-ci-job
329
- name : ${{ matrix.name }}
330
- needs : [ calculate_matrix ]
331
- env :
332
- CI_JOB_NAME : ${{ matrix.image }}
333
- CARGO_REGISTRIES_CRATES_IO_PROTOCOL : sparse
334
- # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
335
- HEAD_SHA : ${{ github.event.pull_request.head.sha || github.sha }}
336
- DOCKER_TOKEN : ${{ secrets.GITHUB_TOKEN }}
337
- SCCACHE_BUCKET : rust-lang-ci-sccache2
338
- TOOLSTATE_REPO : https://github.com/rust-lang-nursery/rust-toolstate
339
- CACHE_DOMAIN : ci-caches.rust-lang.org
340
- continue-on-error : ${{ matrix.continue_on_error || false }}
341
- strategy :
342
- matrix :
343
- # Check the `calculate_matrix` job to see how is the matrix defined.
344
- include : ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
345
- # GitHub Actions fails the workflow if an empty list of jobs is provided to
346
- # the workflow, so we need to skip this job if nothing was produced by
347
- # the Python script.
348
- #
349
- # Unfortunately checking whether a list is empty is not possible in a nice
350
- # way due to GitHub Actions expressions limits.
351
- # This hack is taken from https://github.com/ferrocene/ferrocene/blob/d43edc6b7697cf1719ec1c17c54904ab94825763/.github/workflows/release.yml#L75-L82
352
- if : fromJSON(needs.calculate_matrix.outputs.jobs)[0] != null
353
-
354
- master :
355
- name : master
356
- runs-on : ubuntu-latest
357
- env :
358
- << : [*prod-variables]
359
- if : github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'
360
- steps :
361
- - name : checkout the source code
362
- uses : actions/checkout@v4
363
- with :
364
- fetch-depth : 2
365
-
366
- - name : publish toolstate
367
- run : src/ci/publish_toolstate.sh
368
- shell : bash
369
- env :
370
- TOOLSTATE_REPO_ACCESS_TOKEN : ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
371
-
372
273
# These jobs don't actually test anything, but they're used to tell bors the
373
274
# build completed, as there is no practical way to detect when a workflow is
374
275
# successful listening to webhooks only.
@@ -383,7 +284,18 @@ jobs:
383
284
auto-success :
384
285
needs : [ job ]
385
286
if : " success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
386
- << : *base-success-job
287
+ << : *base-outcome-job
288
+ steps :
289
+ - name : checkout the source code
290
+ uses : actions/checkout@v4
291
+ with :
292
+ fetch-depth : 2
293
+ - name : publish toolstate
294
+ run : src/ci/publish_toolstate.sh
295
+ shell : bash
296
+ env :
297
+ TOOLSTATE_REPO_ACCESS_TOKEN : ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
298
+
387
299
auto-failure :
388
300
needs : [ job ]
389
301
if : " !success() && github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
0 commit comments