Skip to content

Commit

Permalink
GitHub provided runner fallback.
Browse files Browse the repository at this point in the history
Use GitHub provided runners when jetstream2 is not available.
  • Loading branch information
joaander committed Jun 6, 2024
1 parent 357a5e9 commit b027503
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
container_prefix:
type: string
required: true
build_runner:
type: string
required: true
default: ubuntu-latest
test_runner:
type: string
required: true
Expand Down Expand Up @@ -39,7 +43,7 @@ env:

jobs:
build:
runs-on: [self-hosted,jetstream2,CPU]
runs-on: ${{ fromJson(inputs.build_runner) }}
container:
image: glotzerlab/ci:2024.06.04-${{ inputs.container_prefix }}

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests_new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ on:

jobs:
start_action_runners:
name: Start action runners
uses: glotzerlab/jetstream2-admin/.github/workflows/start.yaml@c5d1d59b0b3e069b611f4002bbba4d5ff8e01c60
name: Start
uses: glotzerlab/jetstream2-admin/.github/workflows/start.yaml@a862161adac42e4173f3d142ebd4ddfcde54779b
secrets: inherit

typical:
Expand All @@ -27,6 +27,8 @@ jobs:
with:
config: ${{ join(matrix.config, '_') }}
container_prefix: ${{ matrix.config[0] }}
# Use self-hosted runners or fall back to GitHub hosted runners when self-hosted are offline
build_runner: ${{ needs.start_action_runners.outputs.active }} == "0" && toJson("ubuntu-latest") || toJson([self-hosted,jetstream2,CPU]) }}
# Default to ubuntu-latest when unset
test_runner: ${{ matrix.test_runner == '' && 'ubuntu-latest' || toJson(matrix.test_runner) }}
test_docker_options: ${{ matrix.test_docker_options }}
Expand Down Expand Up @@ -73,16 +75,14 @@ jobs:
with:
config: ${{ join(matrix.config, '_') }}
container_prefix: ${{ matrix.config[0] }}
# Use self-hosted runners or fall back to GitHub hosted runners when self-hosted are offline
build_runner: ${{ needs.start_action_runners.outputs.active }} == "0" && toJson("ubuntu-latest") || toJson([self-hosted,jetstream2,CPU]) }}
# Default to ubuntu-latest when unset
test_runner: ${{ matrix.test_runner == '' && 'ubuntu-latest' || toJson(matrix.test_runner) }}
test_docker_options: ${{ matrix.test_docker_options }}
# Default to false when unset
validate: ${{ matrix.validate == '' && 'false' || matrix.validate }}

# TODO: possible to implelemtn fallback to `ubuntu-latest` when actions runners are offline?

# runs-on: ${{ needs.start_workflow.outputs.exit_code == 3 && 'ubuntu-20.04' || 'ubuntu-24.04' }}

strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit b027503

Please sign in to comment.