Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ on:
required: true
type: string
default: 'ALL'
spack-packages-ref:
description: 'spack-packages ref to use'
builtin-spack-packages-ref:
description: 'spack/spack-packages ref to use'
required: true
type: string
access-spack-packages-ref:
description: 'access-nri/access-spack-packages ref to use'
required: true
type: string
spack-config-ref:
Expand All @@ -27,16 +31,15 @@ jobs:
name: Setup CI
runs-on: ubuntu-latest
env:
# These defaults can be overridden by the inputs (if the trigger is a workflow_dispatch)
DEFAULT_SPACK_REF: 'releases/v1.1'
DEFAULT_SPACK_CONFIG_REF: 'main'
DEFAULT_SPACK_PACKAGES_REF: ${{ github.event.pull_request.head.sha }}
# Note, this needs to be updated in line with refs in the ci job below
BUILD_CI_WORKFLOW_VERSION: v3
PACKAGES_ROOT_DIR: spack_repo/access/nri/packages
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
spack-packages-ref: ${{ steps.set-refs.outputs.spack-packages-ref }}
spack-config-ref: ${{ steps.set-refs.outputs.spack-config-ref }}
spack-ref: ${{ steps.set-refs.outputs.spack-ref }}
builtin-spack-packages-ref: ${{ inputs.builtin-spack-packages-ref }}
access-spack-packages-ref: ${{ inputs.access-spack-packages-ref || github.event.pull_request.head.sha }}
spack-config-ref: ${{ inputs.spack-config-ref || steps.defaults.outputs.spack-config-ref }}
spack-ref: ${{ inputs.spack-ref || steps.defaults.outputs.spack-ref }}
steps:
- name: Checkout spack-packages
uses: actions/checkout@v4
Expand Down Expand Up @@ -120,12 +123,26 @@ jobs:
# Remove the trailing comma and wrap in square brackets
echo "matrix=[${json_entries%,}]" >> $GITHUB_OUTPUT

- name: Set refs
id: set-refs
- name: Checkout build-ci
uses: actions/checkout@v4
with:
repository: access-nri/build-ci
ref: ${{ env.BUILD_CI_WORKFLOW_VERSION }}

- name: Get default refs from build-ci workflow
id: defaults
# GitHub does not treat empty-string inputs as eligible for substitution with a default
# Since we are supporting both workflow_dispatch and pull_request triggers, the entrypoint inputs need to be filled in
# So we are getting the default values from the workflow file itself, and passing them back into the workflow
# builtin-spack-packages-ref does not need this as the input handles the empty string default.
run: |
echo "spack-packages-ref=${{ inputs.spack-packages-ref || env.DEFAULT_SPACK_PACKAGES_REF }}" >> $GITHUB_OUTPUT
echo "spack-config-ref=${{ inputs.spack-config-ref || env.DEFAULT_SPACK_CONFIG_REF }}" >> $GITHUB_OUTPUT
echo "spack-ref=${{ inputs.spack-ref || env.DEFAULT_SPACK_REF }}" >> $GITHUB_OUTPUT
default_spack_ref=$(yq '.on.workflow_call.inputs."spack-ref".default' .github/workflows/ci.yml)
default_spack_config_ref=$(yq '.on.workflow_call.inputs."spack-config-ref".default' .github/workflows/ci.yml)

echo "Default refs from ${{ env.BUILD_CI_WORKFLOW_VERSION }}: spack-ref=$default_spack_ref, spack-config=$default_spack_config_ref"

echo "spack-ref=$default_spack_ref" >> $GITHUB_OUTPUT
echo "spack-config-ref=$default_spack_config_ref" >> $GITHUB_OUTPUT

ci:
name: CI
Expand Down Expand Up @@ -156,10 +173,10 @@ jobs:
spack-manifest-data-path: .github/build-ci/data/standard_definitions.json
spack-manifest-data-pairs: |-
package ${{ matrix.package.template_value }}
builtin-spack-packages-ref: 39aeb9dbcc13b6a53e40c77b672c397e1f4c93ec # fix intel_oneapi_compilers_classic@:2021.10 (#2176)
access-spack-packages-ref: ${{ needs.setup-ci.outputs.spack-packages-ref }}
builtin-spack-packages-ref: ${{ needs.setup-ci.outputs.builtin-spack-packages-ref }}
access-spack-packages-ref: ${{ needs.setup-ci.outputs.access-spack-packages-ref }}
spack-config-ref: ${{ needs.setup-ci.outputs.spack-config-ref }}
spack-ref: ${{ needs.setup-ci.outputs.spack-ref }}
container-image-version: :rocky-v1.1-2025.12.001
# container-image-version: :rocky
secrets:
spack-install-command-pat: ${{ secrets.SPACK_INSTALL_COMMAND_PAT }}