Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/linux-builds.yml
blob: a9c38c665ee31b5725ffeb3a598dfb794d6faf0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Linux Builds

# The Linux hosts are those of the Visual X# compiler, which is the first
# user of this framework: the current Ubuntu LTS, and Fedora in a container.
# Both build with Clang, the compiler that project uses everywhere.

on:
  push:
    branches: [devel]
  pull_request:

permissions:
  contents: read

env:
  CTEST_OUTPUT_ON_FAILURE: 1
  CTEST_NO_TESTS_ACTION: error

jobs:
  ubuntu:
    name: Ubuntu 26.04, C++${{matrix.std}}, ${{matrix.build_type}}
    runs-on: ubuntu-26.04
    timeout-minutes: 45
    strategy:
      fail-fast: false
      matrix:
        build_type: [Debug, Release]
        std: [17, 20]

    steps:
    - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
      with:
        persist-credentials: false

    - name: Install Clang, CMake and Ninja
      run: |
        sudo apt-get update
        sudo apt-get install -y clang cmake ninja-build python3

    - name: Configure
      run: |
        cmake --preset basic-tests -GNinja \
              -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
              -DCMAKE_CXX_COMPILER=clang++ \
              -DCMAKE_CXX_STANDARD=${{matrix.std}} \
              -DCATCH3_BUILD_EXAMPLES=ON \
              -DCATCH3_BUILD_EXTRA_TESTS=ON

    - name: Build
      run: cmake --build build

    - name: Test
      run: ctest --test-dir build -j

    - name: Install, and find the installed package
      run: |
        cmake --install build --prefix "$RUNNER_TEMP/catch3"
        mkdir "$RUNNER_TEMP/consumer"
        cat > "$RUNNER_TEMP/consumer/CMakeLists.txt" <<'EOF'
        cmake_minimum_required(VERSION 3.16)
        project(Consumer CXX)
        find_package(Catch3 REQUIRED)
        EOF
        cmake -S "$RUNNER_TEMP/consumer" -B "$RUNNER_TEMP/consumer/build" \
              -GNinja -DCMAKE_CXX_COMPILER=clang++ \
              -DCMAKE_PREFIX_PATH="$RUNNER_TEMP/catch3"

  thread-sanitizer:
    name: Ubuntu 26.04, C++17, ThreadSanitizer and UBSan
    runs-on: ubuntu-26.04
    timeout-minutes: 45

    steps:
    - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
      with:
        persist-credentials: false

    - name: Install Clang, CMake and Ninja
      run: |
        sudo apt-get update
        sudo apt-get install -y clang cmake ninja-build python3

    - name: Configure with the sanitizers
      env:
        CXXFLAGS: -fsanitize=thread,undefined
        LDFLAGS: -fsanitize=thread,undefined
      run: |
        cmake --preset basic-tests -GNinja \
              -DCMAKE_BUILD_TYPE=Debug \
              -DCMAKE_CXX_COMPILER=clang++ \
              -DCMAKE_CXX_STANDARD=17 \
              -DCATCH3_BUILD_EXTRA_TESTS=ON

    - name: Build
      run: cmake --build build

    - name: Test
      run: ctest --test-dir build -R ThreadSafetyTests

  fedora:
    name: Fedora 43, C++${{matrix.std}}, ${{matrix.build_type}}
    runs-on: ubuntu-26.04
    container: fedora:43
    timeout-minutes: 45
    strategy:
      fail-fast: false
      matrix:
        build_type: [Debug, Release]
        std: [17, 20]

    steps:
    # Git comes first: without it the checkout falls back to an archive of
    # the repository, which is not a checkout the tests can ask questions of.
    - name: Install Git, Clang, CMake and Ninja
      run: dnf install -y git clang gcc-c++ cmake ninja-build python3

    - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
      with:
        persist-credentials: false

    - name: Configure
      run: |
        cmake --preset basic-tests -GNinja \
              -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
              -DCMAKE_CXX_COMPILER=clang++ \
              -DCMAKE_CXX_STANDARD=${{matrix.std}} \
              -DCATCH3_BUILD_EXAMPLES=ON \
              -DCATCH3_BUILD_EXTRA_TESTS=ON

    - name: Build
      run: cmake --build build

    - name: Test
      run: ctest --test-dir build -j