Skip to content

Commit a2cfdb3

Browse files
committed
Add functional test for Spack package installation
- New 'test-install' job that actually installs MFC via Spack - Installs minimal configuration (~mpi ~post_process) to save time - Tests end-to-end workflow: install -> load -> run - Runs 1D Sod shock tube test case - Verifies pre_process and simulation binaries work correctly - 60 minute timeout for installation, 10 minute for execution
1 parent 14491cd commit a2cfdb3

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/spack.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,73 @@ jobs:
109109
run: |
110110
. spack/share/spack/setup-env.sh
111111
spack spec mfc~mpi~post_process
112+
113+
test-install:
114+
name: Test Installation & Execution
115+
runs-on: ubuntu-latest
116+
steps:
117+
- name: Checkout MFC
118+
uses: actions/checkout@v4
119+
120+
- name: Setup Python
121+
uses: actions/setup-python@v5
122+
with:
123+
python-version: '3.11'
124+
125+
- name: Install System Dependencies
126+
run: |
127+
sudo apt-get update
128+
sudo apt-get install -y gfortran cmake
129+
130+
- name: Install Spack
131+
run: |
132+
git clone --depth=1 https://github.com/spack/spack.git
133+
echo "${GITHUB_WORKSPACE}/spack/bin" >> $GITHUB_PATH
134+
135+
- name: Setup Spack
136+
run: |
137+
. spack/share/spack/setup-env.sh
138+
spack compiler find
139+
140+
- name: Install Package into Spack
141+
run: |
142+
. spack/share/spack/setup-env.sh
143+
# Find the actual builtin repo location
144+
BUILTIN_REPO=$(spack repo list | grep builtin | awk '{print $NF}')
145+
echo "Builtin repo location: $BUILTIN_REPO"
146+
# Copy package to the builtin repo
147+
mkdir -p "$BUILTIN_REPO/packages/mfc"
148+
cp packaging/spack/package.py "$BUILTIN_REPO/packages/mfc/"
149+
# Verify package is visible
150+
spack list mfc
151+
152+
- name: Install MFC via Spack
153+
run: |
154+
. spack/share/spack/setup-env.sh
155+
# Install minimal configuration to save time
156+
spack install --show-log-on-error mfc~mpi~post_process
157+
timeout-minutes: 60
158+
159+
- name: Test MFC Execution
160+
run: |
161+
. spack/share/spack/setup-env.sh
162+
spack load mfc
163+
# Verify binaries are available
164+
which pre_process
165+
which simulation
166+
echo "✓ Binaries found"
167+
# Create test directory
168+
mkdir -p test_run
169+
cd test_run
170+
# Copy example case
171+
cp ../examples/1D_sodshocktube/case.py .
172+
# Generate case configuration
173+
python3 case.py > case.json
174+
echo "✓ Generated case configuration"
175+
# Run pre_process
176+
pre_process < case.json
177+
echo "✓ Pre-processing completed"
178+
# Run simulation (just 1 step to verify it works)
179+
simulation
180+
echo "✓ Simulation completed"
181+
timeout-minutes: 10

0 commit comments

Comments
 (0)