1
1
# The builds in this file are more complex (e.g. they need custom CMake
2
2
# configuration) and thus are unsuitable to the simple build matrix
3
3
# approach used in simple-builds
4
- name : Linux builds (complex )
4
+ name : Linux Builds (Complex )
5
5
6
6
on : [push, pull_request]
7
7
@@ -79,63 +79,46 @@ jobs:
79
79
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
80
80
81
81
- name : Configure build
82
- working-directory : ${{runner.workspace}}
83
- env :
84
- CXX : ${{matrix.cxx}}
85
- CXXFLAGS : ${{matrix.cxxflags}}
86
82
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
87
83
# This is important
88
84
run : |
89
- cmake -Bbuild -S$GITHUB_WORKSPACE \
85
+ cmake -Bbuild -GNinja \
90
86
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
87
+ -DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
91
88
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
92
89
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
93
90
-DCMAKE_CXX_EXTENSIONS=OFF \
94
91
-DCATCH_DEVELOPMENT_BUILD=ON \
95
- ${{matrix.cmake_configurations}} \
96
- -G Ninja
92
+ ${{matrix.cmake_configurations}}
97
93
98
- - name : Build tests + lib
99
- working-directory : ${{runner.workspace}}/build
100
- run : ninja
94
+ - name : Build
95
+ run : cmake --build build
96
+
97
+ - name : Test
98
+ run : ctest --test-dir build -j --output-on-failure
101
99
102
- - name : Run tests
103
- working-directory : ${{runner.workspace}}/build
104
- run : ctest -C ${{matrix.build_type}} -j `nproc` ${{matrix.other_ctest_args}} --output-on-failure
105
100
clang-tidy :
106
- name : clang-tidy ${{matrix.version}}, ${{matrix.build_description}}, C++${{matrix.std}} ${{matrix.build_type}}
101
+ name : clang-tidy
107
102
runs-on : ubuntu-22.04
108
- strategy :
109
- matrix :
110
- include :
111
- - version : " 15"
112
- build_description : all
113
- build_type : Debug
114
- std : 17
115
- other_pkgs : ' '
116
- cmake_configurations : -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
117
103
steps :
118
104
- uses : actions/checkout@v4
119
105
120
106
- name : Prepare environment
121
107
run : |
122
108
sudo apt-get update
123
- sudo apt-get install -y ninja-build clang-${{matrix.version}} clang-tidy-${{matrix.version}} ${{matrix.other_pkgs}}
109
+ sudo apt-get install -y ninja-build clang-15 clang-tidy-15
124
110
125
- - name : Configure build
126
- working-directory : ${{runner.workspace}}
127
- env :
128
- CXX : clang++-${{matrix.version}}
129
- CXXFLAGS : ${{matrix.cxxflags}}
111
+ - name : Configure
130
112
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
131
113
# This is important
132
114
run : |
133
- clangtidy="clang-tidy-${{matrix.version}} ;-use-color"
115
+ clangtidy="clang-tidy-15 ;-use-color"
134
116
# Use a dummy compiler/linker/ar/ranlib to effectively disable the
135
117
# compilation and only run clang-tidy.
136
- cmake -Bbuild -S$GITHUB_WORKSPACE \
137
- -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
138
- -DCMAKE_CXX_STANDARD=${{matrix.std}} \
118
+ cmake -Bbuild -GNinja \
119
+ -DCMAKE_BUILD_TYPE=Debug \
120
+ -DCMAKE_CXX_COMPILER=clang++-15 \
121
+ -DCMAKE_CXX_STANDARD=17 \
139
122
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
140
123
-DCMAKE_CXX_EXTENSIONS=OFF \
141
124
-DCATCH_DEVELOPMENT_BUILD=ON \
@@ -145,9 +128,8 @@ jobs:
145
128
-DCMAKE_CXX_COMPILER_AR=/usr/bin/true \
146
129
-DCMAKE_RANLIB=/usr/bin/true \
147
130
-DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \
148
- ${{matrix.cmake_configurations}} \
149
- -G Ninja
131
+ -DCATCH_BUILD_EXAMPLES=ON \
132
+ -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
150
133
151
134
- name : Run clang-tidy
152
- working-directory : ${{runner.workspace}}/build
153
- run : ninja
135
+ run : cmake --build build
0 commit comments