@@ -77,23 +77,53 @@ jobs:
7777
7878 test_palace :
7979 runs-on : ubuntu-latest
80- container :
81- image : benvial/palace:dev
82- name : Test palace:dev docker 3.11
80+ name : Test palace ubuntu-latest 3.11
8381 steps :
8482 - uses : actions/checkout@v4
8583 - uses : astral-sh/setup-uv@v6
86- - name : Install mesa-libGLU
84+ - name : Setup Apptainer
85+ uses : eWaterCycle/setup-apptainer@3f706d898c9db585b1d741b4692e66755f3a1b40
86+ with :
87+ apptainer-version : 1.4.2
88+ - name : Install libglu1-mesa
8789 run : |
88- dnf install -y mesa-libGLU
89- - name : Install dependencies
90+ sudo apt-get install -y libglu1-mesa
91+ - name : Download Palace singularity definition
92+ run : wget https://raw.githubusercontent.com/awslabs/palace/main/singularity/singularity.def
93+ - name : Cache Palace container restore
94+ id : cache-palace-restore
95+ uses : actions/cache/restore@v4
96+ with :
97+ path : palace.sif
98+ key : palace-container-${{ runner.os }}-${{ hashFiles('singularity.def') }}
99+ - name : Build palace from source
100+ if : steps.cache-palace-restore.outputs.cache-hit != 'true'
90101 run : |
91- uv venv -p 3.11
92- uv pip install .[gmsh,dev]
93- - name : Test with pytest
102+ echo "Building Palace container from source (this may take a while)…"
103+ echo "Note: This is a one-time build that will be cached for future runs"
104+ timeout 3600 sudo apptainer build palace.sif singularity.def || {
105+ echo "Build timed out or failed after 60 minutes. Palace tests will be skipped."
106+ exit 1
107+ }
108+ - name : Cache Palace container save
109+ uses : actions/cache/save@v4
110+ if : steps.cache-palace-restore.outputs.cache-hit != 'true'
111+ with :
112+ path : palace.sif
113+ key : palace-container-${{ runner.os }}-${{ hashFiles('singularity.def') }}
114+ - name : Create palace alias
94115 run : |
95- uv run pytest gplugins/palace
96-
116+ # Create a shell script that acts as an alias for palace
117+ echo '#!/bin/bash' > palace
118+ echo "sudo apptainer run $GITHUB_WORKSPACE/palace.sif \"\$@\" " >> palace
119+ chmod +x palace
120+ echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH
121+ echo "Palace executable created successfully"
122+ - name : Verify Palace installation
123+ run : |
124+ palace --help || echo "Palace help failed but container exists"
125+ - name : Test with pytest
126+ run : sudo env "PATH=$PATH" "$(which uv)" run --extra dev --extra gmsh pytest gplugins/palace -v
97127
98128 test_code_coverage :
99129 runs-on : ubuntu-latest
0 commit comments