Dependency Image Pipeline #5
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: Dependency Image Pipeline | |
on: | |
workflow_dispatch: | |
inputs: | |
spack-packages-version: | |
required: true | |
type: string | |
default: "main" | |
description: "Either a git tag or branch name for the ACCESS-NRI/spack_packages repository, which defaults to the main branch" | |
model: | |
required: true | |
type: string | |
description: "A (coupled) model name (eg. access-om2, access-om3)" | |
default: "all" | |
jobs: | |
generate-matrix: | |
name: Generate Matrices | |
runs-on: ubuntu-latest | |
outputs: | |
models: ${{ steps.get-model.outputs.models }} | |
compilers: ${{ steps.get-compiler.outputs.compilers }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Determine correct model(s) to build | |
id: get-model | |
run: | | |
if [[ "${{ inputs.model }}" = "all" ]]; then | |
echo "models=$(jq -cr 'keys' config/models.json)" >> $GITHUB_OUTPUT | |
else | |
query=$(jq -cr '."${{ inputs.model }}"' config/models.json) | |
if [ -z "$query" ]; then | |
exit 1 | |
else | |
echo "models=['${{ inputs.model }}']" >> $GITHUB_OUTPUT | |
fi | |
fi | |
- name: Determine compilers to build | |
id: get-compiler | |
run: echo "compilers=$(jq -c . config/compilers.json)" >> $GITHUB_OUTPUT | |
dependency-image-workflow: | |
name: Create Dependency Image | |
needs: | |
- generate-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: ${{ fromJson(needs.generate-matrix.outputs.compilers) }} | |
uses: access-nri/build-ci/.github/workflows/dep-image-2-build-base.yml@main | |
with: | |
compiler-name: ${{ matrix.compiler.name }} | |
compiler-package: ${{ matrix.compiler.package }} | |
compiler-version: ${{ matrix.compiler.version }} | |
spack-packages-version: ${{ inputs.spack-packages-version }} | |
models: ${{ needs.generate-matrix.outputs.models }} | |
permissions: | |
packages: write | |
contents: read | |
secrets: inherit |