Skip to content

Commit

Permalink
Use spack actions for spack build CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrizka committed Dec 27, 2024
1 parent db7e349 commit 588b6f5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
69 changes: 35 additions & 34 deletions .github/workflows/concretize-template.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,49 @@
name: concretize-template
name: Spack Build

on: push

on:
workflow_call:
inputs:
target:
required: true
type: string
jobs:
concretize:
runs-on: ubuntu-latest
strategy:
fail-fast: false
prepare:
runs-on: ubuntu-22.04
permissions:
packages: write
steps:
- name: Checkout Spack
uses: actions/checkout@v4
- name: Set up Spack
uses: spack/setup-spack@v2
with:
repository: spack/spack
path: spack

- name: Checkout Key4hep
ref: 6cb16c39ab85fbc211e50be804fa7a15f24ccebc # Spack version (examples: develop, releases/v0.23)
buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache
color: true # Force color output (SPACK_COLOR=always)
path: spack # Where to clone Spack
- name: Checkout key4hep repository
uses: actions/checkout@v4
with:
repository: key4hep/key4hep-spack
path: key4hep-spack

- name: Checkout this repo
path: spack/var/repo/key4hep-spack
- name: Checkout mucoll repository
uses: actions/checkout@v4
with:
path: mucoll-spack

- name: Concretize mucoll-common
path: spack/var/repo/mucoll-spack
- name: Apply the patches
run: |
spack/var/repo/mucoll-spack/AlmaLinux9/apply_patches.sh spack/var/repo/key4hep-spack/.cherry-pick
spack/var/repo/mucoll-spack/AlmaLinux9/apply_patches.sh spack/var/repo/mucoll-spack/.cherry-pick
- name: Spack Concretize
shell: spack-bash
run: |
source spack/share/spack/setup-env.sh
spack --version
spack repo add key4hep-spack
spack repo add mucoll-spack
spack repo add spack/var/repo/key4hep-spack
spack repo add spack/var/repo/mucoll-spack
spack compiler find
spack env activate mucoll-spack/environments/mucoll-${{ inputs.target }}
spack add mucoll-stack %gcc@11:
spack concretize
spack spec -Nt > ${GITHUB_WORKSPACE}/spec-${{ inputs.target }}.log
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: spec-list
path: ${GITHUB_WORKSPACE}/spec-${{ inputs.target }}.log
- name: Spack Install
shell: spack-bash
run: |
spack install
- name: Push Spack Packages
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: spack -e . buildcache push --base-image ubuntu:22.04 --update-index local-buildcache
if: ${{ !cancelled() }}
4 changes: 2 additions & 2 deletions .github/workflows/concretize.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: concretize-ubuntu

on: [pull_request]
on: push

jobs:
concretize:
strategy:
fail-fast: false
matrix:
target: [common, release, release-debug]
uses: ./.github/workflows/concretize-template.yaml
uses: .github/workflows/concretize-template.yaml
with:
target: ${{ matrix.target }}

0 comments on commit 588b6f5

Please sign in to comment.