Skip to content

Commit 019ab73

Browse files
committed
Auto merge of #71434 - pietroalbini:shrink-gha-config, r=Mark-Simulacrum
Shrink GHA configuration This shrinks our GHA configuration by [taking advantage of two new features GitHub just announced](https://github.blog/2020-04-22-github-actions-community-momentum-enterprise-capabilities-and-developer-improvements/): * [Default values for `steps[].shell`](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaultsrun) * [Being able to include values in a matrix without having to duplicate the job names.](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-new-combinations) The configuration should be functionally equivalent to the previous one. r? @Mark-Simulacrum
2 parents b592b37 + 61831ff commit 019ab73

File tree

2 files changed

+40
-231
lines changed

2 files changed

+40
-231
lines changed

.github/workflows/ci.yml

+3-129
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ name: CI
2424
pull_request:
2525
branches:
2626
- "**"
27+
defaults:
28+
run:
29+
shell: "python src/ci/exec-with-shell.py {0}"
2730
jobs:
2831
pr:
2932
name: PR
@@ -34,10 +37,6 @@ jobs:
3437
if: "github.event_name == 'pull_request'"
3538
strategy:
3639
matrix:
37-
name:
38-
- mingw-check
39-
- x86_64-gnu-llvm-8
40-
- x86_64-gnu-tools
4140
include:
4241
- name: mingw-check
4342
os: ubuntu-latest-xl
@@ -68,95 +67,74 @@ jobs:
6867
run: src/ci/scripts/setup-environment.sh
6968
env:
7069
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
71-
shell: "python src/ci/exec-with-shell.py {0}"
7270
if: success() && !env.SKIP_JOB
7371
- name: decide whether to skip this job
7472
run: src/ci/scripts/should-skip-this.sh
75-
shell: "python src/ci/exec-with-shell.py {0}"
7673
if: success() && !env.SKIP_JOB
7774
- name: collect CPU statistics
7875
run: src/ci/scripts/collect-cpu-stats.sh
79-
shell: "python src/ci/exec-with-shell.py {0}"
8076
if: success() && !env.SKIP_JOB
8177
- name: show the current environment
8278
run: src/ci/scripts/dump-environment.sh
83-
shell: "python src/ci/exec-with-shell.py {0}"
8479
if: success() && !env.SKIP_JOB
8580
- name: install awscli
8681
run: src/ci/scripts/install-awscli.sh
87-
shell: "python src/ci/exec-with-shell.py {0}"
8882
if: success() && !env.SKIP_JOB
8983
- name: install sccache
9084
run: src/ci/scripts/install-sccache.sh
91-
shell: "python src/ci/exec-with-shell.py {0}"
9285
if: success() && !env.SKIP_JOB
9386
- name: install clang
9487
run: src/ci/scripts/install-clang.sh
95-
shell: "python src/ci/exec-with-shell.py {0}"
9688
if: success() && !env.SKIP_JOB
9789
- name: install WIX
9890
run: src/ci/scripts/install-wix.sh
99-
shell: "python src/ci/exec-with-shell.py {0}"
10091
if: success() && !env.SKIP_JOB
10192
- name: install InnoSetup
10293
run: src/ci/scripts/install-innosetup.sh
103-
shell: "python src/ci/exec-with-shell.py {0}"
10494
if: success() && !env.SKIP_JOB
10595
- name: ensure the build happens on a partition with enough space
10696
run: src/ci/scripts/symlink-build-dir.sh
107-
shell: "python src/ci/exec-with-shell.py {0}"
10897
if: success() && !env.SKIP_JOB
10998
- name: disable git crlf conversion
11099
run: src/ci/scripts/disable-git-crlf-conversion.sh
111-
shell: "python src/ci/exec-with-shell.py {0}"
112100
if: success() && !env.SKIP_JOB
113101
- name: install MSYS2
114102
run: src/ci/scripts/install-msys2.sh
115-
shell: "python src/ci/exec-with-shell.py {0}"
116103
if: success() && !env.SKIP_JOB
117104
- name: install MSYS2 packages
118105
run: src/ci/scripts/install-msys2-packages.sh
119-
shell: "python src/ci/exec-with-shell.py {0}"
120106
if: success() && !env.SKIP_JOB
121107
- name: install MinGW
122108
run: src/ci/scripts/install-mingw.sh
123-
shell: "python src/ci/exec-with-shell.py {0}"
124109
if: success() && !env.SKIP_JOB
125110
- name: install ninja
126111
run: src/ci/scripts/install-ninja.sh
127-
shell: "python src/ci/exec-with-shell.py {0}"
128112
if: success() && !env.SKIP_JOB
129113
- name: enable ipv6 on Docker
130114
run: src/ci/scripts/enable-docker-ipv6.sh
131-
shell: "python src/ci/exec-with-shell.py {0}"
132115
if: success() && !env.SKIP_JOB
133116
- name: disable git crlf conversion
134117
run: src/ci/scripts/disable-git-crlf-conversion.sh
135-
shell: "python src/ci/exec-with-shell.py {0}"
136118
if: success() && !env.SKIP_JOB
137119
- name: checkout submodules
138120
run: src/ci/scripts/checkout-submodules.sh
139-
shell: "python src/ci/exec-with-shell.py {0}"
140121
if: success() && !env.SKIP_JOB
141122
- name: ensure line endings are correct
142123
run: src/ci/scripts/verify-line-endings.sh
143-
shell: "python src/ci/exec-with-shell.py {0}"
144124
if: success() && !env.SKIP_JOB
145125
- name: run the build
146126
run: src/ci/scripts/run-build-from-ci.sh
147127
env:
148128
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
149129
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
150130
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
151-
shell: "python src/ci/exec-with-shell.py {0}"
152131
if: success() && !env.SKIP_JOB
153132
- name: upload artifacts to S3
154133
run: src/ci/scripts/upload-artifacts.sh
155134
env:
156135
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
157136
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
158137
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
159-
shell: "python src/ci/exec-with-shell.py {0}"
160138
try:
161139
name: try
162140
env:
@@ -171,9 +149,6 @@ jobs:
171149
if: "github.event_name == 'push' && github.ref == 'refs/heads/try' && github.repository == 'rust-lang-ci/rust'"
172150
strategy:
173151
matrix:
174-
name:
175-
- dist-x86_64-linux
176-
- dist-x86_64-linux-alt
177152
include:
178153
- name: dist-x86_64-linux
179154
os: ubuntu-latest-xl
@@ -201,95 +176,74 @@ jobs:
201176
run: src/ci/scripts/setup-environment.sh
202177
env:
203178
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
204-
shell: "python src/ci/exec-with-shell.py {0}"
205179
if: success() && !env.SKIP_JOB
206180
- name: decide whether to skip this job
207181
run: src/ci/scripts/should-skip-this.sh
208-
shell: "python src/ci/exec-with-shell.py {0}"
209182
if: success() && !env.SKIP_JOB
210183
- name: collect CPU statistics
211184
run: src/ci/scripts/collect-cpu-stats.sh
212-
shell: "python src/ci/exec-with-shell.py {0}"
213185
if: success() && !env.SKIP_JOB
214186
- name: show the current environment
215187
run: src/ci/scripts/dump-environment.sh
216-
shell: "python src/ci/exec-with-shell.py {0}"
217188
if: success() && !env.SKIP_JOB
218189
- name: install awscli
219190
run: src/ci/scripts/install-awscli.sh
220-
shell: "python src/ci/exec-with-shell.py {0}"
221191
if: success() && !env.SKIP_JOB
222192
- name: install sccache
223193
run: src/ci/scripts/install-sccache.sh
224-
shell: "python src/ci/exec-with-shell.py {0}"
225194
if: success() && !env.SKIP_JOB
226195
- name: install clang
227196
run: src/ci/scripts/install-clang.sh
228-
shell: "python src/ci/exec-with-shell.py {0}"
229197
if: success() && !env.SKIP_JOB
230198
- name: install WIX
231199
run: src/ci/scripts/install-wix.sh
232-
shell: "python src/ci/exec-with-shell.py {0}"
233200
if: success() && !env.SKIP_JOB
234201
- name: install InnoSetup
235202
run: src/ci/scripts/install-innosetup.sh
236-
shell: "python src/ci/exec-with-shell.py {0}"
237203
if: success() && !env.SKIP_JOB
238204
- name: ensure the build happens on a partition with enough space
239205
run: src/ci/scripts/symlink-build-dir.sh
240-
shell: "python src/ci/exec-with-shell.py {0}"
241206
if: success() && !env.SKIP_JOB
242207
- name: disable git crlf conversion
243208
run: src/ci/scripts/disable-git-crlf-conversion.sh
244-
shell: "python src/ci/exec-with-shell.py {0}"
245209
if: success() && !env.SKIP_JOB
246210
- name: install MSYS2
247211
run: src/ci/scripts/install-msys2.sh
248-
shell: "python src/ci/exec-with-shell.py {0}"
249212
if: success() && !env.SKIP_JOB
250213
- name: install MSYS2 packages
251214
run: src/ci/scripts/install-msys2-packages.sh
252-
shell: "python src/ci/exec-with-shell.py {0}"
253215
if: success() && !env.SKIP_JOB
254216
- name: install MinGW
255217
run: src/ci/scripts/install-mingw.sh
256-
shell: "python src/ci/exec-with-shell.py {0}"
257218
if: success() && !env.SKIP_JOB
258219
- name: install ninja
259220
run: src/ci/scripts/install-ninja.sh
260-
shell: "python src/ci/exec-with-shell.py {0}"
261221
if: success() && !env.SKIP_JOB
262222
- name: enable ipv6 on Docker
263223
run: src/ci/scripts/enable-docker-ipv6.sh
264-
shell: "python src/ci/exec-with-shell.py {0}"
265224
if: success() && !env.SKIP_JOB
266225
- name: disable git crlf conversion
267226
run: src/ci/scripts/disable-git-crlf-conversion.sh
268-
shell: "python src/ci/exec-with-shell.py {0}"
269227
if: success() && !env.SKIP_JOB
270228
- name: checkout submodules
271229
run: src/ci/scripts/checkout-submodules.sh
272-
shell: "python src/ci/exec-with-shell.py {0}"
273230
if: success() && !env.SKIP_JOB
274231
- name: ensure line endings are correct
275232
run: src/ci/scripts/verify-line-endings.sh
276-
shell: "python src/ci/exec-with-shell.py {0}"
277233
if: success() && !env.SKIP_JOB
278234
- name: run the build
279235
run: src/ci/scripts/run-build-from-ci.sh
280236
env:
281237
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
282238
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
283239
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
284-
shell: "python src/ci/exec-with-shell.py {0}"
285240
if: success() && !env.SKIP_JOB
286241
- name: upload artifacts to S3
287242
run: src/ci/scripts/upload-artifacts.sh
288243
env:
289244
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
290245
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
291246
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
292-
shell: "python src/ci/exec-with-shell.py {0}"
293247
auto:
294248
name: auto
295249
env:
@@ -304,64 +258,6 @@ jobs:
304258
if: "github.event_name == 'push' && github.ref == 'refs/heads/auto' && github.repository == 'rust-lang-ci/rust'"
305259
strategy:
306260
matrix:
307-
name:
308-
- arm-android
309-
- armhf-gnu
310-
- dist-aarch64-linux
311-
- dist-android
312-
- dist-arm-linux
313-
- dist-armhf-linux
314-
- dist-armv7-linux
315-
- dist-i586-gnu-i586-i686-musl
316-
- dist-i686-freebsd
317-
- dist-i686-linux
318-
- dist-i686-mingw
319-
- dist-i686-msvc
320-
- dist-mips-linux
321-
- dist-mips64-linux
322-
- dist-mips64el-linux
323-
- dist-mipsel-linux
324-
- dist-powerpc-linux
325-
- dist-powerpc64-linux
326-
- dist-powerpc64le-linux
327-
- dist-s390x-linux
328-
- dist-various-1
329-
- dist-various-2
330-
- dist-x86_64-apple
331-
- dist-x86_64-apple-alt
332-
- dist-x86_64-freebsd
333-
- dist-x86_64-linux
334-
- dist-x86_64-linux-alt
335-
- dist-x86_64-mingw
336-
- dist-x86_64-msvc
337-
- dist-x86_64-msvc-alt
338-
- dist-x86_64-musl
339-
- dist-x86_64-netbsd
340-
- i686-gnu
341-
- i686-gnu-nopt
342-
- i686-mingw-1
343-
- i686-mingw-2
344-
- i686-msvc-1
345-
- i686-msvc-2
346-
- mingw-check
347-
- test-various
348-
- wasm32
349-
- x86_64-apple
350-
- x86_64-gnu
351-
- x86_64-gnu-aux
352-
- x86_64-gnu-debug
353-
- x86_64-gnu-distcheck
354-
- x86_64-gnu-full-bootstrap
355-
- x86_64-gnu-llvm-8
356-
- x86_64-gnu-nopt
357-
- x86_64-gnu-tools
358-
- x86_64-mingw-1
359-
- x86_64-mingw-2
360-
- x86_64-msvc-1
361-
- x86_64-msvc-2
362-
- x86_64-msvc-aux
363-
- x86_64-msvc-cargo
364-
- x86_64-msvc-tools
365261
include:
366262
- name: arm-android
367263
os: ubuntu-latest-xl
@@ -631,95 +527,74 @@ jobs:
631527
run: src/ci/scripts/setup-environment.sh
632528
env:
633529
EXTRA_VARIABLES: "${{ toJson(matrix.env) }}"
634-
shell: "python src/ci/exec-with-shell.py {0}"
635530
if: success() && !env.SKIP_JOB
636531
- name: decide whether to skip this job
637532
run: src/ci/scripts/should-skip-this.sh
638-
shell: "python src/ci/exec-with-shell.py {0}"
639533
if: success() && !env.SKIP_JOB
640534
- name: collect CPU statistics
641535
run: src/ci/scripts/collect-cpu-stats.sh
642-
shell: "python src/ci/exec-with-shell.py {0}"
643536
if: success() && !env.SKIP_JOB
644537
- name: show the current environment
645538
run: src/ci/scripts/dump-environment.sh
646-
shell: "python src/ci/exec-with-shell.py {0}"
647539
if: success() && !env.SKIP_JOB
648540
- name: install awscli
649541
run: src/ci/scripts/install-awscli.sh
650-
shell: "python src/ci/exec-with-shell.py {0}"
651542
if: success() && !env.SKIP_JOB
652543
- name: install sccache
653544
run: src/ci/scripts/install-sccache.sh
654-
shell: "python src/ci/exec-with-shell.py {0}"
655545
if: success() && !env.SKIP_JOB
656546
- name: install clang
657547
run: src/ci/scripts/install-clang.sh
658-
shell: "python src/ci/exec-with-shell.py {0}"
659548
if: success() && !env.SKIP_JOB
660549
- name: install WIX
661550
run: src/ci/scripts/install-wix.sh
662-
shell: "python src/ci/exec-with-shell.py {0}"
663551
if: success() && !env.SKIP_JOB
664552
- name: install InnoSetup
665553
run: src/ci/scripts/install-innosetup.sh
666-
shell: "python src/ci/exec-with-shell.py {0}"
667554
if: success() && !env.SKIP_JOB
668555
- name: ensure the build happens on a partition with enough space
669556
run: src/ci/scripts/symlink-build-dir.sh
670-
shell: "python src/ci/exec-with-shell.py {0}"
671557
if: success() && !env.SKIP_JOB
672558
- name: disable git crlf conversion
673559
run: src/ci/scripts/disable-git-crlf-conversion.sh
674-
shell: "python src/ci/exec-with-shell.py {0}"
675560
if: success() && !env.SKIP_JOB
676561
- name: install MSYS2
677562
run: src/ci/scripts/install-msys2.sh
678-
shell: "python src/ci/exec-with-shell.py {0}"
679563
if: success() && !env.SKIP_JOB
680564
- name: install MSYS2 packages
681565
run: src/ci/scripts/install-msys2-packages.sh
682-
shell: "python src/ci/exec-with-shell.py {0}"
683566
if: success() && !env.SKIP_JOB
684567
- name: install MinGW
685568
run: src/ci/scripts/install-mingw.sh
686-
shell: "python src/ci/exec-with-shell.py {0}"
687569
if: success() && !env.SKIP_JOB
688570
- name: install ninja
689571
run: src/ci/scripts/install-ninja.sh
690-
shell: "python src/ci/exec-with-shell.py {0}"
691572
if: success() && !env.SKIP_JOB
692573
- name: enable ipv6 on Docker
693574
run: src/ci/scripts/enable-docker-ipv6.sh
694-
shell: "python src/ci/exec-with-shell.py {0}"
695575
if: success() && !env.SKIP_JOB
696576
- name: disable git crlf conversion
697577
run: src/ci/scripts/disable-git-crlf-conversion.sh
698-
shell: "python src/ci/exec-with-shell.py {0}"
699578
if: success() && !env.SKIP_JOB
700579
- name: checkout submodules
701580
run: src/ci/scripts/checkout-submodules.sh
702-
shell: "python src/ci/exec-with-shell.py {0}"
703581
if: success() && !env.SKIP_JOB
704582
- name: ensure line endings are correct
705583
run: src/ci/scripts/verify-line-endings.sh
706-
shell: "python src/ci/exec-with-shell.py {0}"
707584
if: success() && !env.SKIP_JOB
708585
- name: run the build
709586
run: src/ci/scripts/run-build-from-ci.sh
710587
env:
711588
AWS_ACCESS_KEY_ID: "${{ env.CACHES_AWS_ACCESS_KEY_ID }}"
712589
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}"
713590
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
714-
shell: "python src/ci/exec-with-shell.py {0}"
715591
if: success() && !env.SKIP_JOB
716592
- name: upload artifacts to S3
717593
run: src/ci/scripts/upload-artifacts.sh
718594
env:
719595
AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}"
720596
AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}"
721597
if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')"
722-
shell: "python src/ci/exec-with-shell.py {0}"
723598
master:
724599
name: master
725600
runs-on: ubuntu-latest
@@ -741,7 +616,6 @@ jobs:
741616
run: src/ci/publish_toolstate.sh
742617
env:
743618
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
744-
shell: "python src/ci/exec-with-shell.py {0}"
745619
if: success() && !env.SKIP_JOB
746620
try-success:
747621
needs:

0 commit comments

Comments
 (0)