@@ -25,38 +25,11 @@ jobs:
25
25
fail-fast : false
26
26
matrix :
27
27
include :
28
- # Linux
29
- - os : ubuntu-22.04
30
- fcompiler : gfortran-9
31
- ccompiler : gcc-9
32
- shell : bash
33
- build_type : coverage
34
- memcheck : true
35
-
36
- - os : ubuntu-22.04
37
- fcompiler : gfortran-9
38
- ccompiler : gcc-9
39
- shell : bash
40
- build_type : debug
41
- memcheck : false
42
-
43
- - os : ubuntu-22.04
44
- fcompiler : gfortran-10
45
- ccompiler : gcc-10
46
- shell : bash
47
- build_type : debug
48
- memcheck : false
49
-
50
- - os : ubuntu-22.04
51
- fcompiler : gfortran-11
52
- ccompiler : gcc-11
53
- shell : bash
54
- build_type : debug
55
- memcheck : false
56
-
57
28
- os : ubuntu-22.04
58
29
fcompiler : gfortran-12
59
30
ccompiler : gcc-12
31
+
32
+ spack_os : " ubuntu:22.04"
60
33
shell : bash
61
34
build_type : debug
62
35
memcheck : false
@@ -69,14 +42,29 @@ jobs:
69
42
- name : Checkout repository
70
43
uses : actions/checkout@v3
71
44
72
-
73
45
- name : Show version information
74
46
run : |
75
47
${{ matrix.fcompiler }} --version
76
48
${{ matrix.ccompiler }} --version
77
49
50
+ - name : Set up Spack
51
+ uses : spack/setup-spack@v2
52
+ with :
53
+ ref : develop # Spack version (examples: develop, releases/v0.21)
54
+ buildcache : true # Configure oci://ghcr.io/spack/github-actions-buildcache
55
+ color : true # Force color output (SPACK_COLOR=always)
56
+ path : spack # Where to clone Spack
57
+
58
+ - name : Install dependencies in spack environment
59
+ run : |
60
+ # set the compiler to use for builds
61
+ spack compiler find
62
+ spack config add packages:all:compiler:[${{ matrix.spack_compiler }}]
63
+ spack -e . install --no-check-signature
64
+
78
65
- name : Build with Cmake
79
66
run : |
67
+ spack env activate .
80
68
mkdir build
81
69
cd build
82
70
FC=${{ matrix.fcompiler }} CC=${{ matrix.ccompiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
@@ -123,5 +111,11 @@ jobs:
123
111
echo $f
124
112
valgrind --undef-value-errors=no --error-exitcode=1 -s $f -A
125
113
done
114
+
115
+ - name : Push packages and update index
116
+ run : |
117
+ spack -e . mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
118
+ spack -e . buildcache push --base-image ${{ matrix.spack_os }} --update-index local-buildcache
119
+ if : ${{ !cancelled() }}
126
120
127
121
0 commit comments