Skip to content

Commit 1decc49

Browse files
committed
ci: Use YAML anchor and aliases for repeated "CI script" steps
1 parent dff1bc1 commit 1decc49

File tree

1 file changed

+15
-75
lines changed

1 file changed

+15
-75
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ jobs:
111111
name: Checkout
112112
uses: actions/checkout@v5
113113

114-
- name: CI script
114+
- &CI_SCRIPT_IN_DOCKER
115+
name: CI script
115116
env: ${{ matrix.configuration.env_vars }}
116117
uses: ./.github/actions/run-in-docker-action
117118
with:
@@ -148,13 +149,7 @@ jobs:
148149

149150
steps:
150151
- *CHECKOUT
151-
152-
- name: CI script
153-
env: ${{ matrix.configuration.env_vars }}
154-
uses: ./.github/actions/run-in-docker-action
155-
with:
156-
dockerfile: ./ci/linux-debian.Dockerfile
157-
152+
- *CI_SCRIPT_IN_DOCKER
158153
- *PRINT_LOGS
159154

160155
s390x_debian:
@@ -182,13 +177,7 @@ jobs:
182177

183178
steps:
184179
- *CHECKOUT
185-
186-
- name: CI script
187-
env: ${{ matrix.configuration.env_vars }}
188-
uses: ./.github/actions/run-in-docker-action
189-
with:
190-
dockerfile: ./ci/linux-debian.Dockerfile
191-
180+
- *CI_SCRIPT_IN_DOCKER
192181
- *PRINT_LOGS
193182

194183
arm32_debian:
@@ -218,13 +207,7 @@ jobs:
218207

219208
steps:
220209
- *CHECKOUT
221-
222-
- name: CI script
223-
env: ${{ matrix.configuration.env_vars }}
224-
uses: ./.github/actions/run-in-docker-action
225-
with:
226-
dockerfile: ./ci/linux-debian.Dockerfile
227-
210+
- *CI_SCRIPT_IN_DOCKER
228211
- *PRINT_LOGS
229212

230213
arm64-debian:
@@ -257,13 +240,7 @@ jobs:
257240

258241
steps:
259242
- *CHECKOUT
260-
261-
- name: CI script
262-
env: ${{ matrix.configuration.env_vars }}
263-
uses: ./.github/actions/run-in-docker-action
264-
with:
265-
dockerfile: ./ci/linux-debian.Dockerfile
266-
243+
- *CI_SCRIPT_IN_DOCKER
267244
- *PRINT_LOGS
268245

269246
ppc64le_debian:
@@ -291,13 +268,7 @@ jobs:
291268

292269
steps:
293270
- *CHECKOUT
294-
295-
- name: CI script
296-
env: ${{ matrix.configuration.env_vars }}
297-
uses: ./.github/actions/run-in-docker-action
298-
with:
299-
dockerfile: ./ci/linux-debian.Dockerfile
300-
271+
- *CI_SCRIPT_IN_DOCKER
301272
- *PRINT_LOGS
302273

303274
valgrind_debian:
@@ -343,13 +314,7 @@ jobs:
343314

344315
steps:
345316
- *CHECKOUT
346-
347-
- name: CI script
348-
env: ${{ matrix.configuration.env_vars }}
349-
uses: ./.github/actions/run-in-docker-action
350-
with:
351-
dockerfile: ./ci/linux-debian.Dockerfile
352-
317+
- *CI_SCRIPT_IN_DOCKER
353318
- *PRINT_LOGS
354319

355320
sanitizers_debian:
@@ -383,13 +348,7 @@ jobs:
383348

384349
steps:
385350
- *CHECKOUT
386-
387-
- name: CI script
388-
env: ${{ matrix.configuration.env_vars }}
389-
uses: ./.github/actions/run-in-docker-action
390-
with:
391-
dockerfile: ./ci/linux-debian.Dockerfile
392-
351+
- *CI_SCRIPT_IN_DOCKER
393352
- *PRINT_LOGS
394353

395354
msan_debian:
@@ -430,13 +389,7 @@ jobs:
430389

431390
steps:
432391
- *CHECKOUT
433-
434-
- name: CI script
435-
env: ${{ matrix.configuration.env_vars }}
436-
uses: ./.github/actions/run-in-docker-action
437-
with:
438-
dockerfile: ./ci/linux-debian.Dockerfile
439-
392+
- *CI_SCRIPT_IN_DOCKER
440393
- *PRINT_LOGS
441394

442395
mingw_debian:
@@ -468,13 +421,7 @@ jobs:
468421

469422
steps:
470423
- *CHECKOUT
471-
472-
- name: CI script
473-
env: ${{ matrix.configuration.env_vars }}
474-
uses: ./.github/actions/run-in-docker-action
475-
with:
476-
dockerfile: ./ci/linux-debian.Dockerfile
477-
424+
- *CI_SCRIPT_IN_DOCKER
478425
- *PRINT_LOGS
479426

480427
x86_64-macos-native:
@@ -514,7 +461,8 @@ jobs:
514461
- name: Install and cache Valgrind
515462
uses: ./.github/actions/install-homebrew-valgrind
516463

517-
- name: CI script
464+
- &CI_SCRIPT_ON_HOST
465+
name: CI script
518466
env: ${{ matrix.env_vars }}
519467
run: ./ci/ci.sh
520468

@@ -560,9 +508,7 @@ jobs:
560508
brew install --quiet automake libtool gcc
561509
ln -s $(brew --prefix gcc)/bin/gcc-?? /usr/local/bin/gcc
562510
563-
- name: CI script
564-
env: ${{ matrix.env_vars }}
565-
run: ./ci/ci.sh
511+
- *CI_SCRIPT_ON_HOST
566512

567513
- name: Symbol check
568514
env:
@@ -677,13 +623,7 @@ jobs:
677623

678624
steps:
679625
- *CHECKOUT
680-
681-
- name: CI script
682-
env: ${{ matrix.configuration.env_vars }}
683-
uses: ./.github/actions/run-in-docker-action
684-
with:
685-
dockerfile: ./ci/linux-debian.Dockerfile
686-
626+
- *CI_SCRIPT_IN_DOCKER
687627
- *PRINT_LOGS
688628

689629
cxx_headers_debian:

0 commit comments

Comments
 (0)