File tree 6 files changed +88
-40
lines changed
6 files changed +88
-40
lines changed Original file line number Diff line number Diff line change 24
24
run : |
25
25
echo "/host_usr_local/bin" >> $GITHUB_PATH
26
26
script/ci_setup_linux.sh
27
- - name : Setup Dependencies
28
- run : script/ci_setup_dependencies.sh
29
- - name : Build
30
- run : script/ci_build.sh
27
+ - name : Build and Test
28
+ run : script/ci_run.sh run_tests
31
29
32
30
33
31
build_clang :
62
60
apt-get install -y --no-install-recommends libunwind-${{ matrix.build_config.version }}-dev;
63
61
fi
64
62
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
65
- - name : Setup Dependencies
66
- run : script/ci_setup_dependencies.sh
67
- - name : Build
68
- run : script/ci_build.sh
63
+ - name : Build and Test
64
+ run : script/ci_run.sh run_tests
69
65
70
66
71
67
build_osx :
76
72
CXX : clang++
77
73
steps :
78
74
- uses : actions/checkout@main
79
- - name : Setup
80
- run : sudo script/ci_setup_dependencies.sh
81
- - name : Build
82
- run : script/ci_build.sh
75
+ - name : Build and Test
76
+ run : script/ci_run.sh run_tests
83
77
84
78
85
79
build_windows_msvc :
93
87
steps :
94
88
- uses : actions/checkout@main
95
89
- uses : ilammy/msvc-dev-cmd@v1
96
- - name : Setup
97
- shell : bash
98
- run : script/ci_setup_dependencies.sh
99
- - name : Build
90
+ - name : Build and Test
100
91
shell : bash
101
- run : script/ci_build .sh
92
+ run : script/ci_run .sh run_tests
102
93
103
94
104
95
formatting-check :
Original file line number Diff line number Diff line change @@ -16,16 +16,13 @@ jobs:
16
16
steps :
17
17
- name : Checkout
18
18
uses : actions/checkout@main
19
- - name : Install dependencies
20
- run : sudo script/ci_setup_dependencies.sh
21
19
- name : CodeQL Initialization
22
20
uses : github/codeql-action/init@v3
23
21
with :
24
22
languages : cpp
25
23
queries : +security-and-quality
26
24
- name : Build
27
- run : |
28
- cmake -S test -B build
29
- cmake --build build -j 4
25
+ shell : bash
26
+ run : script/ci_run.sh run_build
30
27
- name : CodeQL Analysis
31
28
uses : github/codeql-action/analyze@v3
Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ api_search/frontend/src/Database.elm
12
12
.idea
13
13
cmake-build- * /
14
14
CMakeUserPresets.json
15
+ doctest /
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ #
4
+ # Private Impl
5
+ #
6
+
7
+ # Get the directory of the current script (this is bash's notion of poetry)
8
+ THIS_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
9
+ REPO_DIR=" $THIS_DIR " /..
10
+
11
+ # Determine the install prefix based on the OS
12
+ if [[ " $OSTYPE " == " msys" || " $OSTYPE " == " cygwin" ]]; then
13
+ # Windows path handling is a never ending source of ...
14
+ INSTALL_PREFIX=" $USERPROFILE \\ .local"
15
+ INSTALL_PREFIX=$( cygpath -u " $INSTALL_PREFIX " ) # Make CMake happy when using git bash under windows
16
+ export CMAKE_PREFIX_PATH=$INSTALL_PREFIX ; $CMAKE_PREFIX_PATH # Notice the ";" instead of ":"
17
+ else
18
+ INSTALL_PREFIX=" $HOME /.local"
19
+ export CMAKE_PREFIX_PATH=$INSTALL_PREFIX :$CMAKE_PREFIX_PATH
20
+ fi
21
+
22
+ # Function to install doctest
23
+ _install_doctest () {
24
+ cd " $REPO_DIR "
25
+ git clone --depth=1 --branch=v2.4.11 https://github.com/doctest/doctest
26
+ cd doctest && mkdir -p build && cd build
27
+ cmake .. -DDOCTEST_WITH_TESTS=OFF -DDOCTEST_WITH_MAIN_IN_STATIC_LIB=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
28
+ cmake --build . --config Release --target install
29
+ }
30
+
31
+ # Function to build the project
32
+ _build_impl () {
33
+ cd " $REPO_DIR "
34
+ JOBS=4
35
+ BUILD_TYPE=Release
36
+ cmake -S test -B build -D CMAKE_BUILD_TYPE=${BUILD_TYPE}
37
+ cmake --build build --config ${BUILD_TYPE} -j ${JOBS}
38
+ }
39
+
40
+ # Function to run tests
41
+ _tests_impl () {
42
+ cd " $REPO_DIR /build"
43
+ JOBS=4
44
+ BUILD_TYPE=Release
45
+ ctest -C ${BUILD_TYPE} -j ${JOBS} --output-on-failure
46
+ }
47
+
48
+ #
49
+ # API
50
+ #
51
+
52
+ # API function to run tests
53
+ run_tests () {
54
+ _install_doctest
55
+ _build_impl
56
+ _tests_impl
57
+ }
58
+
59
+ # API function to build the project
60
+ run_build () {
61
+ _install_doctest
62
+ _build_impl
63
+ }
64
+
65
+ # Main script logic
66
+ case " $1 " in
67
+ run_build)
68
+ run_build
69
+ ;;
70
+ run_tests)
71
+ run_tests
72
+ ;;
73
+ * )
74
+ echo " Usage: $0 {run_build|run_tests}"
75
+ exit 1
76
+ ;;
77
+ esac
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments