Skip to content

Commit e11b6b3

Browse files
committed
GitHub provided runner fallback.
Use GitHub provided runners when jetstream2 is not available.
1 parent 357a5e9 commit e11b6b3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/build_and_test.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
container_prefix:
1010
type: string
1111
required: true
12+
build_runner:
13+
type: string
14+
required: true
15+
default: ubuntu-latest
1216
test_runner:
1317
type: string
1418
required: true
@@ -39,7 +43,7 @@ env:
3943

4044
jobs:
4145
build:
42-
runs-on: [self-hosted,jetstream2,CPU]
46+
runs-on: ${{ fromJson(inputs.build_runner) }}
4347
container:
4448
image: glotzerlab/ci:2024.06.04-${{ inputs.container_prefix }}
4549

.github/workflows/tests_new.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ on:
1616

1717
jobs:
1818
start_action_runners:
19-
name: Start action runners
20-
uses: glotzerlab/jetstream2-admin/.github/workflows/start.yaml@c5d1d59b0b3e069b611f4002bbba4d5ff8e01c60
19+
name: Start
20+
uses: glotzerlab/jetstream2-admin/.github/workflows/start.yaml@a862161adac42e4173f3d142ebd4ddfcde54779b
2121
secrets: inherit
2222

2323
typical:
@@ -27,6 +27,8 @@ jobs:
2727
with:
2828
config: ${{ join(matrix.config, '_') }}
2929
container_prefix: ${{ matrix.config[0] }}
30+
# Use self-hosted runners or fall back to GitHub hosted runners when self-hosted are offline
31+
build_runner: ${{ needs.start_action_runners.outputs.active == '0' && 'ubuntu-latest') || '["self-hosted","jetstream2","CPU"]' }}
3032
# Default to ubuntu-latest when unset
3133
test_runner: ${{ matrix.test_runner == '' && 'ubuntu-latest' || toJson(matrix.test_runner) }}
3234
test_docker_options: ${{ matrix.test_docker_options }}
@@ -73,16 +75,14 @@ jobs:
7375
with:
7476
config: ${{ join(matrix.config, '_') }}
7577
container_prefix: ${{ matrix.config[0] }}
78+
# Use self-hosted runners or fall back to GitHub hosted runners when self-hosted are offline
79+
build_runner: ${{ needs.start_action_runners.outputs.active == '0' && 'ubuntu-latest') || '["self-hosted","jetstream2","CPU"]' }}
7680
# Default to ubuntu-latest when unset
7781
test_runner: ${{ matrix.test_runner == '' && 'ubuntu-latest' || toJson(matrix.test_runner) }}
7882
test_docker_options: ${{ matrix.test_docker_options }}
7983
# Default to false when unset
8084
validate: ${{ matrix.validate == '' && 'false' || matrix.validate }}
8185

82-
# TODO: possible to implelemtn fallback to `ubuntu-latest` when actions runners are offline?
83-
84-
# runs-on: ${{ needs.start_workflow.outputs.exit_code == 3 && 'ubuntu-20.04' || 'ubuntu-24.04' }}
85-
8686
strategy:
8787
fail-fast: false
8888
matrix:

0 commit comments

Comments
 (0)