Skip to content

Commit 4c1337e

Browse files
committed
Try Spack GH Action
1 parent d826cfb commit 4c1337e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/ci/spack-envs/clang7_nopy_ompi_h5_ad2/spack.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ spack:
6060

6161
mirrors:
6262
E4S: https://cache.e4s.io
63+
local-buildcache:
64+
url: oci://ghcr.io/openPMD/spack-buildcache
65+
signed: false

.github/workflows/linux.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ jobs:
8585
8686
clang7_nopy_ompi_h5_ad2:
8787
runs-on: ubuntu-20.04
88+
permissions:
89+
packages: write
8890
if: github.event.pull_request.draft == false
8991
steps:
9092
- uses: actions/checkout@v3
@@ -95,12 +97,19 @@ jobs:
9597
run: |
9698
sudo apt-get update
9799
sudo apt-get install clang-7 gfortran libopenmpi-dev python3
98-
sudo .github/workflows/dependencies/install_spack
100+
- name: Set up Spack
101+
uses: spack/setup-spack@v2
102+
with:
103+
ref: 187b8adb4faa7ad8e5de0baab9a610d158772823
104+
buildcache: true
105+
color: true
106+
path: /opt/spack
99107
- name: Build
100108
env: {CC: clang-7, CXX: clang++-7, CXXFLAGS: -Werror}
109+
shell: spack-bash {0}
101110
run: |
102111
eval $(spack env activate --sh .github/ci/spack-envs/clang7_nopy_ompi_h5_ad2/)
103-
spack install
112+
spack install --no-check-signature
104113
105114
share/openPMD/download_samples.sh build
106115
cmake -S . -B build \
@@ -114,6 +123,12 @@ jobs:
114123
cd build
115124
ctest --output-on-failure
116125
126+
- name: Push packages and update index
127+
run: |
128+
spack -e . mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
129+
spack -e . buildcache push --base-image ubuntu:20.04 --update-index local-buildcache
130+
if: ${{ !cancelled() }}
131+
117132
# TODO
118133
# clang7_py36_nompi_h5_ad2_libstdc++
119134

0 commit comments

Comments
 (0)