Skip to content

Commit 15342ad

Browse files
committed
add spack action
1 parent 169c39f commit 15342ad

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

.github/workflows/spack.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Spack
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
actions: read
13+
checks: write
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
21+
linux-ci:
22+
name: Spack
23+
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 600
26+
env:
27+
MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe"
28+
OMPI_CC: ${{ matrix.c-compiler }}
29+
OMPI_CXX: ${{ matrix.cxx-compiler }}
30+
OMP_NUM_THREADS: 1
31+
32+
steps:
33+
- name: Harden Runner
34+
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
35+
with:
36+
egress-policy: audit
37+
38+
- name: Pull ccache cache
39+
if: always()
40+
id: ccache-restore
41+
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
42+
with:
43+
path: /home/runner/.cache/ccache
44+
key: ccache-spack
45+
46+
- name: Install Ubuntu packages
47+
if: always()
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -yq ccache bzip2 ca-certificates g++ gcc gfortran git gzip lsb-release patch python3 tar unzip xz-utils zstd
51+
52+
- name: Get ccache config dir
53+
if: always()
54+
run: ccache --show-config
55+
56+
- name: Clone spack
57+
if: always()
58+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
59+
with:
60+
repository: spack/spack
61+
path: spack
62+
63+
- name: Install
64+
if: always()
65+
run: |
66+
source spack/share/spack/setup-env.sh
67+
spack config add config:ccache:true
68+
spack env create pynucleus
69+
spack env activate pynucleus
70+
spack add py-pynucleus
71+
spack concretize
72+
spack install
73+
74+
- name: Remove ccache cache
75+
if: ${{ steps.ccache-restore.outputs.cache-hit }}
76+
shell: bash
77+
env:
78+
GH_TOKEN: ${{ github.token }}
79+
run: |
80+
gh extension install actions/gh-actions-cache
81+
gh actions-cache delete ccache-spack --confirm
82+
continue-on-error: true
83+
84+
- name: Push ccache cache
85+
if: always()
86+
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
87+
with:
88+
path: /home/runner/.cache/ccache
89+
key: ccache-spack
90+
91+
- name: Ccache report
92+
if: always()
93+
run: ccache -s

0 commit comments

Comments
 (0)