Skip to content

Commit b0b1349

Browse files
committed
Simplify Linux CI jobs
1 parent f9636e5 commit b0b1349

File tree

4 files changed

+38
-64
lines changed

4 files changed

+38
-64
lines changed

.github/workflows/linux-bazel-builds.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Bazel build
1+
name: Linux Builds (Bazel)
22

33
on: [push, pull_request]
44

@@ -14,12 +14,11 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- name: Mount bazel cache
17+
- name: Mount Bazel cache
1818
uses: actions/cache@v3
1919
with:
2020
path: "/home/runner/.cache/bazel"
2121
key: bazel-ubuntu22-gcc11
2222

23-
- name: Build Catch2
24-
run: |
25-
bazelisk build --compilation_mode=${{matrix.compilation_mode}} //...
23+
- name: Build
24+
run: bazelisk build --compilation_mode=${{matrix.compilation_mode}} //...

.github/workflows/linux-meson-builds.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux builds (meson)
1+
name: Linux Builds (Meson)
22

33
on: [push, pull_request]
44

@@ -26,7 +26,7 @@ jobs:
2626
sudo apt-get update
2727
sudo apt-get install -y meson ninja-build ${{matrix.other_pkgs}}
2828
29-
- name: Configure build
29+
- name: Configure
3030
env:
3131
CXX: ${{matrix.cxx}}
3232
CXXFLAGS: -std=c++${{matrix.std}} ${{matrix.cxxflags}}
@@ -35,11 +35,10 @@ jobs:
3535
run: |
3636
meson -Dbuildtype=${{matrix.build_type}} ${{runner.workspace}}/meson-build
3737
38-
- name: Build tests + lib
38+
- name: Build
3939
working-directory: ${{runner.workspace}}/meson-build
4040
run: ninja
4141

42-
- name: Run tests
42+
- name: Test
4343
working-directory: ${{runner.workspace}}/meson-build
44-
run: |
45-
meson test --verbose
44+
run: meson test --verbose

.github/workflows/linux-other-builds.yml

+20-38
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The builds in this file are more complex (e.g. they need custom CMake
22
# configuration) and thus are unsuitable to the simple build matrix
33
# approach used in simple-builds
4-
name: Linux builds (complex)
4+
name: Linux Builds (Complex)
55

66
on: [push, pull_request]
77

@@ -79,63 +79,46 @@ jobs:
7979
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
8080
8181
- name: Configure build
82-
working-directory: ${{runner.workspace}}
83-
env:
84-
CXX: ${{matrix.cxx}}
85-
CXXFLAGS: ${{matrix.cxxflags}}
8682
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
8783
# This is important
8884
run: |
89-
cmake -Bbuild -S$GITHUB_WORKSPACE \
85+
cmake -Bbuild -GNinja \
9086
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
87+
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
9188
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
9289
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
9390
-DCMAKE_CXX_EXTENSIONS=OFF \
9491
-DCATCH_DEVELOPMENT_BUILD=ON \
95-
${{matrix.cmake_configurations}} \
96-
-G Ninja
92+
${{matrix.cmake_configurations}}
9793
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
10199

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
105100
clang-tidy:
106-
name: clang-tidy ${{matrix.version}}, ${{matrix.build_description}}, C++${{matrix.std}} ${{matrix.build_type}}
101+
name: clang-tidy
107102
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
117103
steps:
118104
- uses: actions/checkout@v4
119105

120106
- name: Prepare environment
121107
run: |
122108
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
124110
125-
- name: Configure build
126-
working-directory: ${{runner.workspace}}
127-
env:
128-
CXX: clang++-${{matrix.version}}
129-
CXXFLAGS: ${{matrix.cxxflags}}
111+
- name: Configure
130112
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
131113
# This is important
132114
run: |
133-
clangtidy="clang-tidy-${{matrix.version}};-use-color"
115+
clangtidy="clang-tidy-15;-use-color"
134116
# Use a dummy compiler/linker/ar/ranlib to effectively disable the
135117
# 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 \
139122
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
140123
-DCMAKE_CXX_EXTENSIONS=OFF \
141124
-DCATCH_DEVELOPMENT_BUILD=ON \
@@ -145,9 +128,8 @@ jobs:
145128
-DCMAKE_CXX_COMPILER_AR=/usr/bin/true \
146129
-DCMAKE_RANLIB=/usr/bin/true \
147130
-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
150133
151134
- name: Run clang-tidy
152-
working-directory: ${{runner.workspace}}/build
153-
run: ninja
135+
run: cmake --build build

.github/workflows/linux-simple-builds.yml

+9-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux builds (basic)
1+
name: Linux Builds (Basic)
22

33
on: [push, pull_request]
44

@@ -97,26 +97,20 @@ jobs:
9797
sudo apt-get update
9898
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
9999
100-
- name: Configure build
101-
working-directory: ${{runner.workspace}}
102-
env:
103-
CXX: ${{matrix.cxx}}
104-
CXXFLAGS: ${{matrix.cxxflags}}
100+
- name: Configure
105101
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
106102
# This is important
107103
run: |
108-
cmake -Bbuild -S$GITHUB_WORKSPACE \
104+
cmake -Bbuild -GNinja \
109105
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
106+
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
110107
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
111108
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
112109
-DCMAKE_CXX_EXTENSIONS=OFF \
113-
-DCATCH_DEVELOPMENT_BUILD=ON \
114-
-G Ninja
110+
-DCATCH_DEVELOPMENT_BUILD=ON
115111
116-
- name: Build tests + lib
117-
working-directory: ${{runner.workspace}}/build
118-
run: ninja
112+
- name: Build
113+
run: cmake --build build
119114

120-
- name: Run tests
121-
working-directory: ${{runner.workspace}}/build
122-
run: ctest -C ${{matrix.build_type}} -j `nproc` --output-on-failure
115+
- name: Test
116+
run: ctest --test-dir build -j --output-on-failure

0 commit comments

Comments
 (0)