Skip to content

Commit 72790d4

Browse files
committed
Add caching and fix build issues in Spack CI
Changes: 1. Add GitHub Actions cache for Spack dependencies - Caches spack/opt/spack (installed packages) - Caches spack/var/spack/cache (downloaded sources) - Key based on package.py hash for cache invalidation - Dramatically speeds up subsequent CI runs 2. Split dependency installation into separate step - Install dependencies first (these benefit from cache) - Install MFC separately for clearer CI output - Reduced timeouts since cached builds are much faster 3. Use mfc@master instead of v5.1.0 - v5.1.0 has parallel build dependency issues with m_thermochem - Master branch has fixes for parallel builds - More representative of what users will install Expected improvement: ~70min -> ~10min on cache hit
1 parent cc5e285 commit 72790d4

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/spack.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ jobs:
145145
spack external find --not-buildable cmake python perl gfortran gcc
146146
spack config add "packages:all:target:[x86_64]"
147147
148+
- name: Cache Spack Dependencies
149+
uses: actions/cache@v4
150+
with:
151+
path: |
152+
spack/opt/spack
153+
spack/var/spack/cache
154+
key: spack-deps-${{ runner.os }}-${{ hashFiles('packaging/spack/package.py') }}
155+
restore-keys: |
156+
spack-deps-${{ runner.os }}-
157+
148158
- name: Install Package into Spack
149159
run: |
150160
. spack/share/spack/setup-env.sh
@@ -157,13 +167,20 @@ jobs:
157167
# Verify package is visible
158168
spack list mfc
159169
170+
- name: Install MFC Dependencies
171+
run: |
172+
. spack/share/spack/setup-env.sh
173+
# Install just the dependencies first (these are cached)
174+
spack install --show-log-on-error --only dependencies mfc@master~mpi~post_process
175+
timeout-minutes: 35
176+
160177
- name: Install MFC via Spack
161178
run: |
162179
. spack/share/spack/setup-env.sh
163-
# Install minimal configuration
164-
# Binary cache is already configured, Spack will use it automatically when available
165-
spack install --show-log-on-error mfc~mpi~post_process
166-
timeout-minutes: 45
180+
# Install MFC from master branch (v5.1.0 has parallel build issues)
181+
# This step is fast since dependencies are already installed
182+
spack install --show-log-on-error mfc@master~mpi~post_process
183+
timeout-minutes: 10
167184

168185
- name: Test MFC Execution
169186
run: |

0 commit comments

Comments
 (0)