forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-ci.sh
executable file
·53 lines (43 loc) · 1.27 KB
/
run-ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh -e
OS=$1
CMAKE_PRESET=$2
set -x
test -n "${OS}"
test -n "${CMAKE_PRESET}"
if [ -z "${CELER_SOURCE_DIR}" ]; then
CELER_SOURCE_DIR="$(dirname $0)"/../..
fi
cd "${CELER_SOURCE_DIR}"
CELER_SOURCE_DIR=$(pwd)
ln -fs scripts/cmake-presets/ci-${OS}.json CMakeUserPresets.json
# Source environment script if necessary
_ENV_SCRIPT="scripts/env/ci-${OS}.sh"
if [ -f "${_ENV_SCRIPT}" ]; then
. "${_ENV_SCRIPT}"
fi
# Fetch tags for version provenance
git fetch --tags
# Configure
cmake --preset=${CMAKE_PRESET}
# Build and (optionally) install
cmake --build --preset=${CMAKE_PRESET}
# Require regression-like tests to be enabled and pass
export CELER_TEST_STRICT=1
# Run tests
cd build
ctest \
-j16 --timeout 180 \
--no-compress-output --output-on-failure \
--test-output-size-passed=65536 --test-output-size-failed=1048576 \
# List XML files generated: jenkins will upload these later
find Testing -name '*.xml'
# Install and test that the executables are there
cmake --install .
cd ..
test -x "${CELER_SOURCE_DIR}/install/bin/celer-sim"
test -x "${CELER_SOURCE_DIR}/install/bin/celer-g4"
"${CELER_SOURCE_DIR}/install/bin/celer-sim" --version
# Test examples against installed celeritas
export CMAKE_PRESET
export CELER_SOURCE_DIR
exec ${CELER_SOURCE_DIR}/scripts/ci/test-examples.sh