Skip to content

Commit bbb7436

Browse files
authored
Add input to allow running single CI job (#809)
1 parent ed69a3a commit bbb7436

File tree

2 files changed

+83
-14
lines changed

2 files changed

+83
-14
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
name: Build
22
on:
33
workflow_dispatch:
4+
inputs:
5+
job_id:
6+
type: choice
7+
description: Specific job to run
8+
default: all
9+
required: true
10+
options:
11+
- all
12+
- linux
13+
- alpine
14+
- macos
15+
- windows
16+
- freebsd
17+
- solaris
18+
- zos
19+
- distcheck
20+
- coverage
421
push:
522
branches: [ master, "release/**" ]
623
pull_request:
@@ -19,6 +36,7 @@ jobs:
1936
linux:
2037
name: Linux
2138
runs-on: ubuntu-latest
39+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'linux')
2240
steps:
2341
- name: Setup
2442
run: |
@@ -61,6 +79,7 @@ jobs:
6179
name: alpine
6280
runs-on: ubuntu-latest
6381
container: alpine
82+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'alpine')
6483
steps:
6584
- name: Setup
6685
run: apk add --no-cache automake autoconf gcc libtool make musl-dev git zlib zlib-dev bzip2 bzip2-dev
@@ -100,6 +119,7 @@ jobs:
100119
macos:
101120
name: macOS universal
102121
runs-on: macos-latest
122+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'macos')
103123
steps:
104124
- name: Checkout
105125
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -169,6 +189,7 @@ jobs:
169189
windows:
170190
name: Windows
171191
runs-on: windows-latest
192+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'windows')
172193
strategy:
173194
fail-fast: false
174195
matrix:
@@ -273,7 +294,9 @@ jobs:
273294
freebsd:
274295
name: FreeBSD
275296
runs-on: ubuntu-latest
276-
if: github.event_name != 'pull_request'
297+
if: |
298+
(github.event_name == 'workflow_dispatch' && (inputs.job_id == 'all' || inputs.job_id == 'freebsd')) ||
299+
github.event_name == 'push'
277300
steps:
278301
- name: Checkout
279302
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -323,7 +346,9 @@ jobs:
323346
solaris:
324347
name: Solaris
325348
runs-on: ubuntu-latest
326-
if: github.event_name != 'pull_request'
349+
if: |
350+
(github.event_name == 'workflow_dispatch' && (inputs.job_id == 'all' || inputs.job_id == 'solaris')) ||
351+
github.event_name == 'push'
327352
steps:
328353
- name: Checkout
329354
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -406,7 +431,9 @@ jobs:
406431
zos:
407432
name: z/OS
408433
runs-on: ubuntu-latest
409-
if: github.event_name != 'pull_request'
434+
if: |
435+
(github.event_name == 'workflow_dispatch' && (inputs.job_id == 'all' || inputs.job_id == 'zos')) ||
436+
github.event_name == 'push'
410437
concurrency:
411438
group: zos-ssh-build
412439
steps:
@@ -471,6 +498,7 @@ jobs:
471498
distcheck:
472499
name: Build & verify distribution
473500
runs-on: ubuntu-latest
501+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'distcheck')
474502
permissions:
475503
id-token: write # Needed to make calls to the Sigstore service
476504
attestations: write # Needed to write the attestation to GitHub's database
@@ -527,6 +555,7 @@ jobs:
527555
coverage:
528556
name: Code coverage
529557
runs-on: ubuntu-latest
558+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'coverage')
530559
steps:
531560
- name: Setup
532561
run: |

.github/workflows/dev.yml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
name: Dev
22
on:
33
workflow_dispatch:
4+
inputs:
5+
job_id:
6+
type: choice
7+
description: Specific job to run
8+
default: all
9+
required: true
10+
options:
11+
- all
12+
- canary
13+
- dragon
14+
- greatawk
15+
- dodo
16+
- wasp
17+
- bat
18+
- pterodactyl
19+
- bigbird
20+
- camel
21+
- chaffinch
22+
- fruitbat
23+
- ptarmigan
24+
- zebrilus
25+
- bee
426
push:
527
branches: [ master, "release/**" ]
628
pull_request:
@@ -20,6 +42,7 @@ jobs:
2042
# Tests with: Debug & assertions; link-size=4; libedit
2143
name: GCC -O0
2244
runs-on: ubuntu-latest
45+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'canary')
2346
steps:
2447
- name: Setup
2548
run: |
@@ -54,9 +77,10 @@ jobs:
5477
run: ./pcre2posix_test -v
5578

5679
dragon:
57-
# Tests with: clang AB/UB; link-size=3
80+
# Tests with: clang AB/UB; link-size=3. Clang's logo is a dragon.
5881
name: Clang
5982
runs-on: ubuntu-latest
83+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'dragon')
6084
strategy:
6185
fail-fast: false
6286
matrix:
@@ -95,6 +119,7 @@ jobs:
95119
name: GCC -O3
96120
runs-on: ubuntu-latest
97121
container: ubuntu:22.04
122+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'greatawk')
98123
steps:
99124
- name: Setup
100125
run: |
@@ -173,6 +198,7 @@ jobs:
173198
name: GCC -Os, old Autotools
174199
runs-on: ubuntu-latest
175200
container: ubuntu:22.04
201+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'dodo')
176202
steps:
177203
- name: Setup
178204
run: |
@@ -208,6 +234,7 @@ jobs:
208234
# Tests with: French locale; oldest supported CMake; no JIT; -Os; libreadline
209235
name: GCC -Os, CMake+ninja, no JIT
210236
runs-on: ubuntu-latest
237+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'wasp')
211238
env:
212239
CMAKE_VER: "3.15.7"
213240
steps:
@@ -254,9 +281,10 @@ jobs:
254281
../maint/RunSymbolTest install-dir/lib/ ../maint/
255282
256283
bat:
257-
# Tests with: MSVC 32-bit, and a variety of CMake options
284+
# Tests with: MSVC 32-bit, and a variety of CMake options. Windows has "bat" files.
258285
name: Windows (Win32)
259286
runs-on: windows-latest
287+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'bat')
260288
steps:
261289
- name: Checkout
262290
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -276,6 +304,7 @@ jobs:
276304
# Tests with: MSVC 64-bit, Debug, shared libraries
277305
name: Windows (x64)
278306
runs-on: windows-latest
307+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'pterodactyl')
279308
steps:
280309
- name: Checkout
281310
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -295,6 +324,7 @@ jobs:
295324
# Job to execute ManyConfigTests
296325
name: manyconfig
297326
runs-on: ubuntu-latest
327+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'bigbird')
298328
steps:
299329
- name: Setup
300330
run: |
@@ -313,10 +343,11 @@ jobs:
313343
./maint/ManyConfigTests
314344
315345
camel:
316-
# Job to execute RunPerlTest
346+
# Job to execute RunPerlTest. "Camel bird" is another name for an ostrich (and it's Perl's logo).
317347
name: perl
318348
runs-on: ubuntu-latest
319349
container: perl:devel
350+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'camel')
320351
steps:
321352
- name: Checkout
322353
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -334,6 +365,7 @@ jobs:
334365
# functions or macros which collide.
335366
name: CMake unity build
336367
runs-on: ubuntu-latest
368+
if: github.event_name != 'workflow_dispatch' || (inputs.job_id == 'all' || inputs.job_id == 'chaffinch')
337369
env:
338370
# Disallowing shadowing would be very spammy for unity builds, because the
339371
# same variable name can be used in multiple files.
@@ -353,11 +385,13 @@ jobs:
353385
- name: Test
354386
run: cd build && ctest -j3 --output-on-failure
355387

356-
msys2:
388+
fruitbat:
357389
# Tests with: MSYS2 unix-on-Windows environment
358390
name: MSYS2
359391
runs-on: windows-latest
360-
if: github.event_name != 'pull_request'
392+
if: |
393+
(github.event_name == 'workflow_dispatch' && (inputs.job_id == 'all' || inputs.job_id == 'fruitbat')) ||
394+
github.event_name == 'push'
361395
strategy:
362396
fail-fast: false
363397
matrix:
@@ -427,7 +461,9 @@ jobs:
427461
permissions:
428462
contents: read
429463
packages: write # Necessary for uraimo/run-on-arch-action to use GitHub's Docker repository as a cache
430-
if: github.event_name != 'pull_request'
464+
if: |
465+
(github.event_name == 'workflow_dispatch' && (inputs.job_id == 'all' || inputs.job_id == 'ptarmigan')) ||
466+
github.event_name == 'push'
431467
steps:
432468
- name: Checkout
433469
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -464,10 +500,12 @@ jobs:
464500
(cd build && ctest -j3 --output-on-failure)
465501
466502
zebrilus:
467-
# Tests with: Zig compiler
503+
# Tests with: Zig compiler. A "zebrilus" is known as a "zigzag heron".
468504
name: Zig
469505
runs-on: ubuntu-latest
470-
if: github.event_name != 'pull_request'
506+
if: |
507+
(github.event_name == 'workflow_dispatch' && (inputs.job_id == 'all' || inputs.job_id == 'zebrilus')) ||
508+
github.event_name == 'push'
471509
steps:
472510
- name: Setup
473511
run: |
@@ -485,15 +523,17 @@ jobs:
485523
run: |
486524
srcdir=`pwd` pcre2test=`pwd`/zig-out/bin/pcre2test ./RunTest -bigstack
487525
488-
bazel:
489-
# Tests with: Bazel build system
526+
bee:
527+
# Tests with: Bazel build system. A bee goes "buzz buzz buzz(el)".
490528
name: Bazel
491529
strategy:
492530
fail-fast: false
493531
matrix:
494532
os: ["ubuntu-latest", "windows-latest"]
495533
runs-on: ${{ matrix.os }}
496-
if: github.event_name != 'pull_request'
534+
if: |
535+
(github.event_name == 'workflow_dispatch' && (inputs.job_id == 'all' || inputs.job_id == 'bee')) ||
536+
github.event_name == 'push'
497537
steps:
498538
- name: Checkout
499539
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

0 commit comments

Comments
 (0)