|
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 | + - master |
| 66 | + pull_request: |
| 67 | + branches: |
| 68 | + - "**" |
| 69 | + |
| 70 | +permissions: |
| 71 | + contents: read |
| 72 | + packages: write |
| 73 | + |
| 74 | +defaults: |
| 75 | + run: |
| 76 | + # On Linux, macOS, and Windows, use the system-provided bash as the default |
| 77 | + # shell. (This should only make a difference on Windows, where the default |
| 78 | + # shell is PowerShell.) |
| 79 | + shell: bash |
| 80 | + |
| 81 | +concurrency: |
| 82 | + # For a given workflow, if we push to the same branch, cancel all previous builds on that branch. |
| 83 | + # We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which |
| 84 | + # are all triggered on the same branch, but which should be able to run concurrently. |
| 85 | + group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }} |
| 86 | + cancel-in-progress: true |
| 87 | + |
| 88 | +jobs: |
| 89 | + # The job matrix for `calculate_matrix` is defined in src/ci/github-actions/jobs.yml. |
| 90 | + # It calculates which jobs should be executed, based on the data of the ${{ github }} context. |
| 91 | + # If you want to modify CI jobs, take a look at src/ci/github-actions/jobs.yml. |
| 92 | + calculate_matrix: |
| 93 | + name: Calculate job matrix |
| 94 | + runs-on: ubuntu-latest |
| 95 | + outputs: |
| 96 | + jobs: ${{ steps.jobs.outputs.jobs }} |
| 97 | + steps: |
| 98 | + - name: Checkout the source code |
| 99 | + uses: actions/checkout@v4 |
| 100 | + - name: Calculate the CI job matrix |
| 101 | + run: python3 src/ci/github-actions/calculate-job-matrix.py >> $GITHUB_OUTPUT |
| 102 | + id: jobs |
| 103 | + job: |
| 104 | + name: ${{ matrix.name }} |
| 105 | + needs: [ calculate_matrix ] |
| 106 | + runs-on: "${{ matrix.os }}" |
111 | 107 | defaults: |
112 | 108 | run: |
113 | 109 | shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }} |
114 | 110 | timeout-minutes: 600 |
115 | | - runs-on: "${{ matrix.os }}" |
116 | | - env: *shared-ci-variables |
| 111 | + env: |
| 112 | + CI_JOB_NAME: ${{ matrix.image }} |
| 113 | + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse |
| 114 | + # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs. |
| 115 | + HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} |
| 116 | + DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 117 | + SCCACHE_BUCKET: rust-lang-ci-sccache2 |
| 118 | + TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate |
| 119 | + CACHE_DOMAIN: ci-caches.rust-lang.org |
| 120 | + continue-on-error: ${{ matrix.continue_on_error || false }} |
| 121 | + strategy: |
| 122 | + matrix: |
| 123 | + # Check the `calculate_matrix` job to see how is the matrix defined. |
| 124 | + include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }} |
| 125 | + # GitHub Actions fails the workflow if an empty list of jobs is provided to |
| 126 | + # the workflow, so we need to skip this job if nothing was produced by |
| 127 | + # the Python script. |
| 128 | + # |
| 129 | + # Unfortunately checking whether a list is empty is not possible in a nice |
| 130 | + # way due to GitHub Actions expressions limits. |
| 131 | + # This hack is taken from https://github.com/ferrocene/ferrocene/blob/d43edc6b7697cf1719ec1c17c54904ab94825763/.github/workflows/release.yml#L75-L82 |
| 132 | + if: fromJSON(needs.calculate_matrix.outputs.jobs)[0] != null |
117 | 133 | steps: |
118 | 134 | - if: contains(matrix.os, 'windows') |
119 | 135 | uses: msys2/setup-msys2@v2.22.0 |
@@ -253,104 +269,6 @@ x--expand-yaml-anchors--remove: |
253 | 269 | # erroring about invalid credentials instead. |
254 | 270 | if: success() && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1') |
255 | 271 |
|
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 | 272 | # These jobs don't actually test anything, but they're used to tell bors the |
355 | 273 | # build completed, as there is no practical way to detect when a workflow is |
356 | 274 | # successful listening to webhooks only. |
|
0 commit comments