Skip to content

Commit 1c57403

Browse files
committed
various ci fixes, and using only specific tests for sanitizers
1 parent 5f5142f commit 1c57403

4 files changed

Lines changed: 37 additions & 12 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363

6464
# Initializes the CodeQL tools for scanning.
6565
- name: Initialize CodeQL
66-
uses: github/codeql-action/init@v3
66+
uses: github/codeql-action/init@v4
6767
with:
6868
languages: ${{ matrix.language }}
6969
build-mode: ${{ matrix.build-mode }}

.github/workflows/docker.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ jobs:
144144
# build layers are imported from a previously exported BuildKit cache
145145
# cache-from: ${{ env.CACHE_REF }}
146146
# publishes the BuildKit cache to your container registry under that tag
147-
cache-to: ${{ env.CACHE_REF }},mode=max
148-
147+
cache-to: ${{ env.CACHE_REF }},mode=max
149148

150149
# export logs from the logs-export stage in the dockerfile to the runner’s filesystem (no docker pull)
151150
- name: Export logs (runner artifact)
@@ -159,7 +158,6 @@ jobs:
159158
cache-from: ${{ env.CACHE_REF }}
160159
outputs: type=local,dest=${{ runner.temp }}/artifacts/${{ matrix.logs_dir }}
161160

162-
163161
- name: Upload logs artifact
164162
uses: actions/upload-artifact@v4
165163
with:

ci/build.sh

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,38 @@ fi
5858

5959
show_gemc_installation
6060

61+
test_options=(
62+
-C build
63+
--print-errorlogs
64+
-j 1
65+
--no-rebuild
66+
--num-processes 1
67+
)
68+
69+
# Specific tests to run when sanitizer is enabled
70+
sanitizer_tests=(
71+
api_run_gemc_with_replaced_geometry_using_G4Box_with_formatascii
72+
test_gstreamer_csv
73+
test_gparticle_double
74+
test_event_dispenser
75+
examples_geo_basic_simple_flux_ascii_variation_default
76+
)
77+
78+
79+
meson_args=( "${test_options[@]}" )
80+
6181
# if $1 is NOT one of sanitize option, run meson test
6282
case "$1" in
6383
address|thread|undefined|leak)
64-
# sanitizer option -> do NOT run meson test
84+
meson_args+=( "${sanitizer_tests[@]}" )
6585
;;
6686
*)
67-
echo " > Running meson test with options -C build -j 1 --print-errorlogs --no-rebuild --num-processes 1" | tee -a "$test_log"
68-
meson test -C build -v -j 1 --print-errorlogs --no-rebuild --num-processes 1 >> "$test_log"
69-
echo " - Successful: $(grep -m1 'Ok:' "$test_log" | awk '{print $2}')"
70-
echo " - Failures: $(grep -m1 'Fail:' "$test_log" | awk '{print $2}')"
71-
echo " > Complete test log: $test_log"
87+
meson_args+=( -v )
7288
;;
7389
esac
90+
91+
echo " > Running meson test with options:" "${meson_args[@]}" | tee -a "$test_log"
92+
meson test "${meson_args[@]}" >> "$test_log"
93+
echo " - Successful: $(grep -m1 'Ok:' "$test_log" | awk '{print $2}')"
94+
echo " - Failures: $(grep -m1 'Fail:' "$test_log" | awk '{print $2}')"
95+
echo " > Complete test log: $test_log"

meson/meson.build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,24 @@ sanitize = get_option('b_sanitize') # string option: 'none', 'address', 'undefi
109109
# only use shared libraries if a sanitizer option is passed
110110
# this will avoid duplicate symbols errors when sanitizer is used, coming from static library usage
111111
use_sharedl = (sanitize != 'none')
112+
cmake_opts.add_cmake_defines({
113+
'BUILD_SHARED_LIBS': use_sharedl,
114+
# Avoid pulling GUI/sample/tooling deps like X11
115+
'ASSIMP_BUILD_ASSIMP_TOOLS': false,
116+
'ASSIMP_BUILD_SAMPLES': false,
117+
'ASSIMP_BUILD_TESTS': false,
118+
})
112119

113120

114121
if host_machine.system() == 'darwin'
115122
# there's a macro collision in Assimp’s bundled zlib on macOS.
116123
# Using system zlib is fine on macos
117124
cmake_opts.add_cmake_defines({
118-
'BUILD_SHARED_LIBS': use_sharedl,
119125
'ASSIMP_BUILD_ZLIB' : false,
120126
})
121127
else
122128
# Ubuntu: zlib is not compiled with fPic on the system. Let Assimp compile it.
123129
cmake_opts.add_cmake_defines({
124-
'BUILD_SHARED_LIBS': use_sharedl,
125130
'ASSIMP_BUILD_ZLIB' : true,
126131
})
127132
endif

0 commit comments

Comments
 (0)