Update spack.yaml #7
This file contains hidden or 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: Build and push to Spack build cache | |
on: | |
workflow_dispatch: {} | |
push: | |
paths: | |
- "spack.yaml" | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup spack | |
uses: spack/setup-spack@v2.1.1 | |
with: | |
ref: develop | |
- name: Create spack environment | |
shell: bash | |
run: | | |
spack env create myenv spack.yaml | |
- name: Add mochi-spack-packages | |
shell: bash | |
run: | | |
git clone https://github.com/mochi-hpc/mochi-spack-packages | |
spack -e myenv repo add mochi-spack-packages | |
- name: Install spack environment | |
shell: bash | |
run: | | |
spack -e myenv concretize --fresh | |
spack -e myenv install | |
- name: Add token to buildcache | |
shell: bash | |
run: | | |
spack -e myenv mirror set --push \ | |
--oci-username ${{ github.actor }} \ | |
--oci-password-variable MY_OCI_TOKEN mochi-buildcache | |
- name: Push packages to buildcache and update index | |
shell: bash | |
run: | | |
MY_OCI_TOKEN=${{ secrets.GITHUB_TOKEN }} \ | |
spack -e myenv buildcache push --base-image ubuntu:22.04 \ | |
--unsigned --update-index mochi-buildcache |