Skip to content

Commit bfcb3f2

Browse files
committed
feat: add check-geometry-configs-geant4 too
1 parent 1c7e218 commit bfcb3f2

3 files changed

Lines changed: 52 additions & 1 deletion

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Check geometry configs (Geant4)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
detector_configs:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
check-geometry-configs:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- uses: actions/download-artifact@v8
16+
with:
17+
name: build-gcc-nightly-fast-eic-shell
18+
path: install/
19+
- uses: cvmfs-contrib/github-action-cvmfs@v5
20+
- uses: eic/run-cvmfs-osg-eic-shell@main
21+
with:
22+
platform-release: "eic_xl:nightly"
23+
setup: install/bin/thisepic.sh
24+
run: |
25+
export DETECTOR_CACHE=/opt/detector/epic-main/share/epic
26+
MEMORY_LIMIT_KB=2350000 # 2.35 GB – update this deliberately when geometry grows
27+
IFS=, read -a configs <<< "${{inputs.detector_configs}}"
28+
overall_rc=0
29+
for config in ${configs[@]} ; do
30+
echo "::group::${config}" ;
31+
/usr/bin/time -v -o /tmp/time_${config}.txt \
32+
g4GeometryScan -c ${DETECTOR_PATH}/${config}.xml -d 0,0,1
33+
rc=$?
34+
peak_rss_kb=$(grep "Maximum resident set size" /tmp/time_${config}.txt | awk '{print $NF}')
35+
echo "Peak RSS for ${config}: ${peak_rss_kb} kB (limit: ${MEMORY_LIMIT_KB} kB)"
36+
echo "::endgroup::"
37+
if [ "${peak_rss_kb}" -gt "${MEMORY_LIMIT_KB}" ]; then
38+
echo "::error::Memory limit exceeded for ${config}: ${peak_rss_kb} kB > ${MEMORY_LIMIT_KB} kB"
39+
overall_rc=1
40+
fi
41+
[ $rc -ne 0 ] && overall_rc=$rc
42+
done
43+
exit $overall_rc

.github/workflows/check-geometry-configs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check geometry configs
1+
name: Check geometry configs (TGeo)
22

33
on:
44
workflow_call:

.github/workflows/linux-eic-shell.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ jobs:
138138
with:
139139
detector_configs: ${{needs.list-detector-configs.outputs.configs_csv}}
140140

141+
check-geometry-configs-geant4:
142+
needs:
143+
- build
144+
- list-detector-configs
145+
uses: ./.github/workflows/check-geometry-configs-geant4.yml
146+
with:
147+
detector_configs: "epic_craterlake"
148+
141149
check-tracking-geometry:
142150
needs: build
143151
uses: ./.github/workflows/check-tracking-geometry.yml

0 commit comments

Comments
 (0)