1
0
mirror of https://github.com/catchorg/Catch2.git synced 2025-05-01 13:03:51 +00:00

Simplify Linux CI jobs

This commit is contained in:
Chris Thrasher 2025-04-26 19:27:32 -06:00
parent c17d69f813
commit 10d1a2750c
No known key found for this signature in database
GPG Key ID: 56FB686C9DFC8E2C
4 changed files with 38 additions and 64 deletions

View File

@ -1,4 +1,4 @@
name: Bazel build
name: Linux Builds (Bazel)
on: [push, pull_request]
@ -14,12 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Mount bazel cache
- name: Mount Bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel-ubuntu22-gcc11
- name: Build Catch2
run: |
bazelisk build --compilation_mode=${{matrix.compilation_mode}} //...
- name: Build
run: bazelisk build --compilation_mode=${{matrix.compilation_mode}} //...

View File

@ -1,4 +1,4 @@
name: Linux builds (meson)
name: Linux Builds (Meson)
on: [push, pull_request]
@ -26,7 +26,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y meson ninja-build ${{matrix.other_pkgs}}
- name: Configure build
- name: Configure
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: -std=c++${{matrix.std}} ${{matrix.cxxflags}}
@ -35,11 +35,10 @@ jobs:
run: |
meson -Dbuildtype=${{matrix.build_type}} ${{runner.workspace}}/meson-build
- name: Build tests + lib
- name: Build
working-directory: ${{runner.workspace}}/meson-build
run: ninja
- name: Run tests
- name: Test
working-directory: ${{runner.workspace}}/meson-build
run: |
meson test --verbose
run: meson test --verbose

View File

@ -1,7 +1,7 @@
# The builds in this file are more complex (e.g. they need custom CMake
# configuration) and thus are unsuitable to the simple build matrix
# approach used in simple-builds
name: Linux builds (complex)
name: Linux Builds (Complex)
on: [push, pull_request]
@ -79,63 +79,46 @@ jobs:
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
cmake -Bbuild -S$GITHUB_WORKSPACE \
cmake -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCATCH_DEVELOPMENT_BUILD=ON \
${{matrix.cmake_configurations}} \
-G Ninja
${{matrix.cmake_configurations}}
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build -j --output-on-failure
- name: Run tests
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -j `nproc` ${{matrix.other_ctest_args}} --output-on-failure
clang-tidy:
name: clang-tidy ${{matrix.version}}, ${{matrix.build_description}}, C++${{matrix.std}} ${{matrix.build_type}}
name: clang-tidy
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- version: "15"
build_description: all
build_type: Debug
std: 17
other_pkgs: ''
cmake_configurations: -DCATCH_BUILD_EXAMPLES=ON -DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
steps:
- uses: actions/checkout@v4
- name: Prepare environment
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang-${{matrix.version}} clang-tidy-${{matrix.version}} ${{matrix.other_pkgs}}
sudo apt-get install -y ninja-build clang-15 clang-tidy-15
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: clang++-${{matrix.version}}
CXXFLAGS: ${{matrix.cxxflags}}
- name: Configure
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
clangtidy="clang-tidy-${{matrix.version}};-use-color"
clangtidy="clang-tidy-15;-use-color"
# Use a dummy compiler/linker/ar/ranlib to effectively disable the
# compilation and only run clang-tidy.
cmake -Bbuild -S$GITHUB_WORKSPACE \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
cmake -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER=clang++-15 \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCATCH_DEVELOPMENT_BUILD=ON \
@ -145,9 +128,8 @@ jobs:
-DCMAKE_CXX_COMPILER_AR=/usr/bin/true \
-DCMAKE_RANLIB=/usr/bin/true \
-DCMAKE_CXX_LINK_EXECUTABLE=/usr/bin/true \
${{matrix.cmake_configurations}} \
-G Ninja
-DCATCH_BUILD_EXAMPLES=ON \
-DCATCH_ENABLE_CMAKE_HELPER_TESTS=ON
- name: Run clang-tidy
working-directory: ${{runner.workspace}}/build
run: ninja
run: cmake --build build

View File

@ -1,4 +1,4 @@
name: Linux builds (basic)
name: Linux Builds (Basic)
on: [push, pull_request]
@ -97,26 +97,20 @@ jobs:
sudo apt-get update
sudo apt-get install -y ninja-build ${{matrix.other_pkgs}}
- name: Configure build
working-directory: ${{runner.workspace}}
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{matrix.cxxflags}}
- name: Configure
# Note: $GITHUB_WORKSPACE is distinct from ${{runner.workspace}}.
# This is important
run: |
cmake -Bbuild -S$GITHUB_WORKSPACE \
cmake -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCATCH_DEVELOPMENT_BUILD=ON \
-G Ninja
-DCATCH_DEVELOPMENT_BUILD=ON
- name: Build tests + lib
working-directory: ${{runner.workspace}}/build
run: ninja
- name: Build
run: cmake --build build
- name: Run tests
working-directory: ${{runner.workspace}}/build
run: ctest -C ${{matrix.build_type}} -j `nproc` --output-on-failure
- name: Test
run: ctest --test-dir build -j --output-on-failure