Add patch for geant4 #32
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: Spack buildcache build | |
on: | |
workflow_call: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
fresh: | |
type: boolean | |
description: Create a fresh buildcache | |
default: false | |
env: | |
SPACK_BACKTRACE: 1 | |
SPACK_REF: 866785bd74964142e4b47bf71bee68d7426c84ee # develop@2024-12-31 | |
jobs: | |
rebuild: | |
runs-on: ubuntu-24.04 | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: Setup Spack | |
uses: spack/setup-spack@5792f7c7055c3707819380b5e3831d2be6e64b6c # 2024/12 | |
with: | |
ref: ${{env.SPACK_REF}} | |
buildcache: true | |
color: true | |
- name: Patch spack | |
run: | | |
curl -LfsS https://github.com/spack/spack/pull/48328.patch | git -C spack apply - | |
curl -LfsS https://github.com/spack/spack/pull/48332.patch | git -C spack apply - | |
- name: Find compilers | |
run: spack -e . compiler find --mixed-toolchain | |
- name: Set buildcache | |
run: | | |
spack mirror add --unsigned upstream oci://ghcr.io/spack/github-actions-buildcache | |
spack mirror add --unsigned celer-buildcache oci://ghcr.io/celeritas-project/spack-gha-buildcache | |
- name: Concretize (fresh) | |
run: spack -e . -v concretize --fresh | |
if: ${{ github.event.inputs.fresh == 'true' }} | |
- name: Concretize (reuse) | |
run: spack -e . -v concretize | |
if: ${{ github.event.inputs.fresh == 'false' || github.event_name != 'workflow_dispatch' }} | |
- name: Install | |
run: | | |
spack -e . env depfile -o Makefile | |
make -Orecurse -j $(($(nproc) + 1)) SPACK_INSTALL_FLAGS=--no-check-signature | |
- name: Push packages and update index | |
env: | |
GITHUB_USER: ${{github.actor}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
spack mirror set --push --oci-username-variable GITHUB_USER --oci-password-variable GITHUB_TOKEN celer-buildcache | |
spack -e . buildcache push -j $(($(nproc) + 1)) --base-image ubuntu:22.04 --update-index celer-buildcache | |
if: ${{ !cancelled() }} |