Skip to content

Commit 3535900

Browse files
committed
add build-test to ci
1 parent ba2029d commit 3535900

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: build-test
22
on:
33
pull_request:
44
branches:
@@ -27,3 +27,28 @@ jobs:
2727
echo "PARENT_DIR=$PWD" >> $GITHUB_ENV
2828
echo "CONAN_HOME=$PWD/.conan2" >> $GITHUB_ENV
2929
echo "GTEST_COLOR=1" >> $GITHUB_ENV
30+
31+
- name: set env variables for cdash
32+
run: |
33+
if [[ $GITHUB_EVENT_NAME == "push" ]]; then
34+
echo "TEST_MODEL=Continuous" >> $GITHUB_ENV
35+
echo "TEST_NAME=\"${{ matrix.compiler }} (master)\"" >> $GITHUB_ENV
36+
elif [[ $GITHUB_EVENT_NAME == "schedule" ]]; then
37+
echo "TEST_MODEL=Nightly" >> $GITHUB_ENV
38+
echo "TEST_NAME=\"${{ matrix.compiler }} (master)\"" >> $GITHUB_ENV
39+
else
40+
echo "TEST_MODEL=Experimental" >> $GITHUB_ENV
41+
export PULL_NR=${{ github.event.number }}
42+
echo "TEST_NAME=\"$${{ matrix.compiler }} (pr.${PULL_NR})\"" >> $GITHUB_ENV
43+
fi
44+
45+
# Be very careful about CTEST_BUILD_NAME. It shouldn't contain additional double quotations
46+
- name: build-test-submit
47+
run: |
48+
ctest -S cmake/ctest_dashboard.cmake -VV\
49+
-DTEST_MODEL=${TEST_MODEL}\
50+
-DCTEST_CONFIGURATION_TYPE=Debug\
51+
-DCTEST_BUILD_NAME=${{ env.TEST_NAME }}\
52+
-DCTEST_SITE="Github CI/CD"\
53+
-DCONFIGURE_PRESET="debug-${{ matrix.compiler }}"\
54+
--output-on-failure

test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ target_sources(
88
PRIVATE centipede_unit_test.cpp unit_tests/centipede.cpp
99
)
1010
target_link_libraries(unit_test PRIVATE GTest::gtest_main centipede::centipede)
11+
12+
gtest_discover_tests(unit_test)

0 commit comments

Comments
 (0)