Spack GitHub action #5
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: Spack | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| actions: read | |
| checks: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| linux-ci: | |
| name: Spack | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 600 | |
| env: | |
| MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe" | |
| OMPI_CC: ${{ matrix.c-compiler }} | |
| OMPI_CXX: ${{ matrix.cxx-compiler }} | |
| OMP_NUM_THREADS: 1 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | |
| with: | |
| egress-policy: audit | |
| - name: Pull ccache cache | |
| if: always() | |
| id: ccache-restore | |
| uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| path: /home/runner/.cache/ccache | |
| key: ccache-spack | |
| - name: Install Ubuntu packages | |
| if: always() | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -yq ccache | |
| - name: Get ccache config dir | |
| if: always() | |
| run: ccache --show-config | |
| - name: Set up Spack | |
| uses: spack/setup-spack@v2 | |
| with: | |
| ref: releases/v0.23.1 | |
| buildcache: true | |
| color: true | |
| path: spack | |
| - name: Install PyNucleus | |
| shell: spack-bash {0} | |
| run: | | |
| spack config add config:ccache:true | |
| spack env create pynucleus | |
| spack env activate pynucleus | |
| spack add py-pynucleus | |
| spack concretize | |
| spack install | |
| - name: Remove ccache cache | |
| if: ${{ steps.ccache-restore.outputs.cache-hit }} | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh extension install actions/gh-actions-cache | |
| gh actions-cache delete ccache-spack --confirm | |
| continue-on-error: true | |
| - name: Push ccache cache | |
| if: always() | |
| uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
| with: | |
| path: /home/runner/.cache/ccache | |
| key: ccache-spack | |
| - name: Ccache report | |
| if: always() | |
| run: ccache -s |