Skip to content

Dependency Image Pipeline #49

Dependency Image Pipeline

Dependency Image Pipeline #49

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"
spack-config-version:
required: true
type: string
default: "main"
description: "Either a git tag or branch name for the ACCESS-NRI/spack-config repository"
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.yml@main
with:
compiler-name: ${{ matrix.compiler.COMPILER_NAME }}
compiler-version: ${{ matrix.compiler.COMPILER_VERSION }}
compiler-pkg-name: ${{ matrix.compiler.COMPILER_PKG_NAME }}
compiler-pkg-version: ${{ matrix.compiler.COMPILER_PKG_VERSION }}
spack-packages-version: ${{ inputs.spack-packages-version }}
spack-config-version: ${{ inputs.spack-config-version }}
models: ${{ needs.generate-matrix.outputs.models }}
permissions:
packages: write
contents: read
secrets: inherit