Refactor CI workflows #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
types: [opened, labeled, reopened, synchronize] | |
push: | |
branches: | |
- "trunk-*" | |
workflow_dispatch: | |
jobs: | |
start_action_runners: | |
name: Start action runners | |
uses: glotzerlab/jetstream2-admin/.github/workflows/start.yaml@c5d1d59b0b3e069b611f4002bbba4d5ff8e01c60 | |
secrets: inherit | |
typical: | |
name: "${{ join(matrix.config, '_') }}" | |
needs: start_action_runners | |
uses: ./.github/workflows/build_and_test.yaml | |
with: | |
config: ${{ join(matrix.config, '_') }} | |
container_prefix: ${{ matrix.config[0] }} | |
# 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 }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- config: [clang14_py311, mpi, tbb, llvm] | |
validate: 'true' | |
- config: [gcc13_py312] | |
validate: 'true' | |
- config: [cuda120_gcc11_py310, mpi, llvm] | |
test_runner: [self-hosted,GPU] | |
test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' | |
validate: 'true' | |
- config: [cuda120_gcc11_py310] | |
test_runner: [self-hosted,GPU] | |
test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' | |
validate: 'true' | |
- config: [gcc13_py312, nomd] | |
- config: [gcc13_py312, nohpmc] | |
- config: [gcc13_py312, nomd, nohpmc] | |
- config: [cuda120_gcc11_py310, mpi, llvm, debug] | |
test_runner: [self-hosted,GPU] | |
test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' | |
- config: [gcc9_py39] | |
release: | |
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }} | |
name: "${{ join(matrix.config, '_') }}" | |
needs: start_action_runners | |
uses: ./.github/workflows/build_and_test.yaml | |
with: | |
config: ${{ join(matrix.config, '_') }} | |
container_prefix: ${{ matrix.config[0] }} | |
# 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: | |
include: | |
- config: [clang18_py312, mpi] | |
- config: [clang17_py312, mpi] | |
- config: [clang16_py312, mpi, llvm] | |
- config: [clang15_py312, mpi, llvm] | |
- config: [clang13_py310, llvm] | |
- config: [clang12_py310, llvm] | |
- config: [clang11_py310, llvm] | |
- config: [gcc14_py312] | |
- config: [gcc12_py311] | |
- config: [gcc11_py310] | |
- config: [gcc10_py310] | |
- config: [cuda118_gcc11_py310, mpi, llvm] | |
test_runner: [self-hosted,GPU] | |
test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' | |
- config: [cuda117_gcc11_py310, mpi, llvm] | |
test_runner: [self-hosted,GPU] | |
test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' | |
tests_complete: | |
name: Unit test | |
if: always() | |
needs: [typical] | |
runs-on: ubuntu-latest | |
steps: | |
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' | |
- name: Done | |
run: exit 0 |