Skip to content

Commit

Permalink
Add surface geometry to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sethrj committed Sep 24, 2024
1 parent 5265793 commit 0c943b7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 7 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/build-spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
- geometry: "vecgeom"
special: "clhep"
geant: "11.0"
- geometry: "vecgeom"
special: "vgsurf"
geant: "11.0"
- geometry: "geant4"
special: null
geant: "11.0"
Expand Down Expand Up @@ -76,10 +79,12 @@ jobs:
# TODO: https://github.com/spack/spack/pull/43136
curl -LfsS https://github.com/spack/spack/pull/43136.patch | git -C spack-src apply -
cp scripts/ci/spack.yaml .
if [ "${{matrix.geometry}}" == "vecgeom" ]; then
if [ "${{matrix.geometry}}" == "vecgeom" ] && [ "${{matrix.special}}" != "vgsurf" ]; then
spack -e . add vecgeom
fi
if [ "${{matrix.special}}" != "minimal" ] && [ "${{matrix.special}}" != "asanlite" ] ; then
if [ "${{matrix.special}}" != "minimal" ] \
&& [ "${{matrix.special}}" != "asanlite" ] \
&& [ "${{matrix.special}}" != "vgsurf" ] ; then
spack -e . add root
fi
if [ "${{matrix.geant}}" != "" ]; then
Expand Down Expand Up @@ -125,6 +130,33 @@ jobs:
- name: Zero ccache stats
run: |
ccache -z
- name: Install VecGeom surface
if: ${{matrix.geometry == 'vecgeom' && matrix.special == 'vgsurf'}}
run: |
. ${SPACK_VIEW}/rc
git clone -b surface_model --depth=368 \
https://gitlab.cern.ch/VecGeom/VecGeom.git vecgeom
cd vecgeom
mkdir build
cd build
export VECGEOM_PREFIX_PATH=$GITHUB_WORKSPACE/vecgeom/install
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_STANDARD:STRING=17 \
-DVECGEOM_BACKEND:STRING=Scalar -DVECGEOM_VECTOR:STRING=empty \
-DVECGEOM_BUILTIN_VECCORE:BOOL=ON \
-DVECGEOM_NO_SPECIALIZATION:BOOL=ON \
-DVECGEOM_USE_SURF:BOOL=ON -DVECGEOM_USE_NAVTUPLE:BOOL=OFF -DVECGEOM_USE_NAVINDEX:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DVECGEOM_GDML:BOOL=ON -DVECGEOM_ENABLE_CUDA:BOOL=OFF -DVECGEOM_GEANT4:BOOL=OFF -DVECGEOM_ROOT:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX:STRING=$VECGEOM_PREFIX_PATH \
-G Ninja \
..
ninja install
echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:${VECGEOM_PREFIX_PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${VECGEOM_PREFIX_PATH}/lib" >> $GITHUB_ENV
- name: Configure Celeritas
env:
CLANG_TIDY: "clang-tidy-15"
Expand All @@ -137,14 +169,18 @@ jobs:
run: |
ninja -v -k0
- name: Regenerate ROOT test data
if: ${{matrix.geant == '11.0'}}
if: ${{
matrix.geant == '11.0'
&& matrix.special != 'minimal'
&& matrix.special != 'vgsurf'
}}
working-directory: build
run: |
ninja -v -k0 update-root-test-data
- name: Run tests
id: test
working-directory: build
continue-on-error: ${{fromJSON(matrix.geant) < 11}} # TODO: fix failing tests
continue-on-error: ${{fromJSON(matrix.geant) < 11}}
run: |
if [ "${{matrix.geant}}" == "11.0" ]; then
# Note this is ignored for geant4, float, clhep
Expand All @@ -166,7 +202,7 @@ jobs:
# TODO: ASAN requires flags downstream
if: >-
${{
(matrix.special != 'asanlite')
matrix.special != 'asanlite'
}}
run: |
. ${SPACK_VIEW}/rc
Expand All @@ -187,7 +223,7 @@ jobs:
# TODO: ASAN requires flags downstream
if: >-
${{
(matrix.special != 'asanlite')
matrix.special != 'asanlite'
}}
run: |
. ${SPACK_VIEW}/rc
Expand Down
9 changes: 8 additions & 1 deletion scripts/cmake-presets/ci-ubuntu-github.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"},
"CMAKE_EXPORT_COMPILE_COMMANDS": {"type": "BOOL", "value": "ON"},
"CMAKE_CXX_CLANG_TIDY": {"type": "PATH", "value": "$env{CLANG_TIDY}"}

}
},
{
Expand All @@ -106,6 +105,14 @@
"cacheVariables": {
}
},
{
"name": "reldeb-vecgeom-vgsurf",
"description": "Build with release, assertions, VecGeom",
"inherits": ["reldeb-vecgeom"],
"cacheVariables": {
"CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"}
}
},
{
"name": "ndebug-vecgeom",
"description": "Build release with vecgeom for testing *only* demos",
Expand Down

0 comments on commit 0c943b7

Please sign in to comment.