Skip to content

Commit 7156c5f

Browse files
CodeGatharshula
authored andcommitted
build-ci v3: Update Infra For spack v1 (#353)
infra: Update to v3, get default spack-config-ref/spack-ref from build-ci workflow, use default container-image-version
1 parent 1d2b69c commit 7156c5f

1 file changed

Lines changed: 34 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ on:
1010
required: true
1111
type: string
1212
default: 'ALL'
13-
spack-packages-ref:
14-
description: 'spack-packages ref to use'
13+
builtin-spack-packages-ref:
14+
description: 'spack/spack-packages ref to use'
15+
required: true
16+
type: string
17+
access-spack-packages-ref:
18+
description: 'access-nri/access-spack-packages ref to use'
1519
required: true
1620
type: string
1721
spack-config-ref:
@@ -27,16 +31,15 @@ jobs:
2731
name: Setup CI
2832
runs-on: ubuntu-latest
2933
env:
30-
# These defaults can be overridden by the inputs (if the trigger is a workflow_dispatch)
31-
DEFAULT_SPACK_REF: 'releases/v1.1'
32-
DEFAULT_SPACK_CONFIG_REF: 'main'
33-
DEFAULT_SPACK_PACKAGES_REF: ${{ github.event.pull_request.head.sha }}
34+
# Note, this needs to be updated in line with refs in the ci job below
35+
BUILD_CI_WORKFLOW_VERSION: v3
3436
PACKAGES_ROOT_DIR: spack_repo/access/nri/packages
3537
outputs:
3638
matrix: ${{ steps.set-matrix.outputs.matrix }}
37-
spack-packages-ref: ${{ steps.set-refs.outputs.spack-packages-ref }}
38-
spack-config-ref: ${{ steps.set-refs.outputs.spack-config-ref }}
39-
spack-ref: ${{ steps.set-refs.outputs.spack-ref }}
39+
builtin-spack-packages-ref: ${{ inputs.builtin-spack-packages-ref }}
40+
access-spack-packages-ref: ${{ inputs.access-spack-packages-ref || github.event.pull_request.head.sha }}
41+
spack-config-ref: ${{ inputs.spack-config-ref || steps.defaults.outputs.spack-config-ref }}
42+
spack-ref: ${{ inputs.spack-ref || steps.defaults.outputs.spack-ref }}
4043
steps:
4144
- name: Checkout spack-packages
4245
uses: actions/checkout@v4
@@ -120,12 +123,26 @@ jobs:
120123
# Remove the trailing comma and wrap in square brackets
121124
echo "matrix=[${json_entries%,}]" >> $GITHUB_OUTPUT
122125
123-
- name: Set refs
124-
id: set-refs
126+
- name: Checkout build-ci
127+
uses: actions/checkout@v4
128+
with:
129+
repository: access-nri/build-ci
130+
ref: ${{ env.BUILD_CI_WORKFLOW_VERSION }}
131+
132+
- name: Get default refs from build-ci workflow
133+
id: defaults
134+
# GitHub does not treat empty-string inputs as eligible for substitution with a default
135+
# Since we are supporting both workflow_dispatch and pull_request triggers, the entrypoint inputs need to be filled in
136+
# So we are getting the default values from the workflow file itself, and passing them back into the workflow
137+
# builtin-spack-packages-ref does not need this as the input handles the empty string default.
125138
run: |
126-
echo "spack-packages-ref=${{ inputs.spack-packages-ref || env.DEFAULT_SPACK_PACKAGES_REF }}" >> $GITHUB_OUTPUT
127-
echo "spack-config-ref=${{ inputs.spack-config-ref || env.DEFAULT_SPACK_CONFIG_REF }}" >> $GITHUB_OUTPUT
128-
echo "spack-ref=${{ inputs.spack-ref || env.DEFAULT_SPACK_REF }}" >> $GITHUB_OUTPUT
139+
default_spack_ref=$(yq '.on.workflow_call.inputs."spack-ref".default' .github/workflows/ci.yml)
140+
default_spack_config_ref=$(yq '.on.workflow_call.inputs."spack-config-ref".default' .github/workflows/ci.yml)
141+
142+
echo "Default refs from ${{ env.BUILD_CI_WORKFLOW_VERSION }}: spack-ref=$default_spack_ref, spack-config=$default_spack_config_ref"
143+
144+
echo "spack-ref=$default_spack_ref" >> $GITHUB_OUTPUT
145+
echo "spack-config-ref=$default_spack_config_ref" >> $GITHUB_OUTPUT
129146
130147
ci:
131148
name: CI
@@ -156,11 +173,11 @@ jobs:
156173
spack-manifest-data-path: .github/build-ci/data/standard_definitions.json
157174
spack-manifest-data-pairs: |-
158175
package ${{ matrix.package.template_value }}
159-
builtin-spack-packages-ref: 39aeb9dbcc13b6a53e40c77b672c397e1f4c93ec # fix intel_oneapi_compilers_classic@:2021.10 (#2176)
160-
access-spack-packages-ref: ${{ needs.setup-ci.outputs.spack-packages-ref }}
176+
builtin-spack-packages-ref: ${{ needs.setup-ci.outputs.builtin-spack-packages-ref }}
177+
access-spack-packages-ref: ${{ needs.setup-ci.outputs.access-spack-packages-ref }}
161178
spack-config-ref: ${{ needs.setup-ci.outputs.spack-config-ref }}
162179
spack-ref: ${{ needs.setup-ci.outputs.spack-ref }}
163180
allow-ssh-into-spack-install: false
164-
container-image-version: :rocky-v1.1-2025.12.001
181+
# container-image-version: :rocky
165182
secrets:
166183
spack-install-command-pat: ${{ secrets.SPACK_INSTALL_COMMAND_PAT }}

0 commit comments

Comments
 (0)