Skip to content

Commit 8f4a5f4

Browse files
authored
Merge pull request #27 from neatudarius/experimental/enable-clang-19
Enable clang-19 tests on CI
2 parents 248adc8 + 4986cbf commit 8f4a5f4

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

β€Ž.github/workflows/ci.ymlβ€Ž

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
config:
1515
- {name: "Ubuntu Clang 17", os: ubuntu-24.04, toolchain: "clang-17-toolchain.cmake", clang_version: 17, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
1616
- {name: "Ubuntu Clang 18", os: ubuntu-24.04, toolchain: "clang-18-toolchain.cmake", clang_version: 18, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
17+
# Note: clang-19 + Asan setup causes errors on some platforms. Temporary skip some checks via .asan_options.
18+
- {name: "Ubuntu Clang 19", os: ubuntu-24.04, toolchain: "clang-19-toolchain.cmake", clang_version: 19, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" ", asan_options: "new_delete_type_mismatch=0"}
1719
- {name: "Ubuntu GCC 13", os: ubuntu-24.04, toolchain: "gcc-13-toolchain.cmake", clang_version: 17, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
1820
- {name: "Ubuntu GCC 14", os: ubuntu-24.04, toolchain: "gcc-14-toolchain.cmake", clang_version: 17, installed_clang_version: 14, cmake_args: "-G \"Ninja Multi-Config\" -DCMAKE_CONFIGURATION_TYPES=\"RelWithDebInfo;Asan\" "}
1921
steps:
@@ -53,10 +55,12 @@ jobs:
5355
- name: Install GCC 14
5456
if: matrix.config.name == 'Ubuntu GCC 14'
5557
run: |
58+
set -x
5659
sudo apt update
5760
sudo apt-get install g++-14
5861
- name: Configure
5962
run: |
63+
set -x
6064
rm -rf .build
6165
mkdir -p .build
6266
cd .build
@@ -65,8 +69,11 @@ jobs:
6569
cmake ${{ matrix.config.cmake_args }} -DCMAKE_TOOLCHAIN_FILE=etc/${{ matrix.config.toolchain }} -B . -S ..
6670
- name: Build
6771
run: |
72+
set -x
6873
cmake --build .build --config Asan --target all -- -k 0
6974
- name: Test
7075
run: |
76+
set -x
7177
cd .build
72-
ctest --output-on-failure
78+
[[ ! -z "${{ matrix.config.asan_options }}" ]] && export ASAN_OPTIONS="${{ matrix.config.asan_options }}"
79+
ctest --build-config Asan --output-on-failure

β€Ždocs/debug-ci.mdβ€Ž

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Debug CI
2+
3+
<!--
4+
SPDX-License-Identifier: 2.0 license with LLVM exceptions
5+
-->
6+
7+
## CI flows
8+
9+
CI flows are found in [.github/workflows/](.github/workflows/). Usually, they are run when generating a Git Action (e.g. at `push`).
10+
11+
WIP to add flows for tests, linting etc.
12+
13+
## Run CI Flows on Local Setup
14+
15+
We can use [nektos/act](https://github.com/nektos/act) to simulate and test Git Actions on local setup.
16+
Setup and tutorial on [nektosact.com/](https://nektosact.com/).
17+
18+
```shell
19+
# Check available jobs
20+
$ sudo act --container-architecture linux/amd64 --list
21+
Stage Job ID Job name Workflow name Workflow file Events
22+
0 build ${{ matrix.config.name }} CI Tests ci.yml pull_request,push
23+
24+
# Run all CI jobs
25+
Optional26 $ sudo act -P ubuntu-24.04=ghcr.io/catthehacker/ubuntu:full-24.04 --container-architecture linux/amd64 push
26+
[CI Tests/Ubuntu Clang 18-2] πŸš€ Start image=ghcr.io/catthehacker/ubuntu:full-24.04
27+
[CI Tests/Ubuntu Clang 19-3] πŸš€ Start image=ghcr.io/catthehacker/ubuntu:full-24.04
28+
[CI Tests/Ubuntu Clang 17-1] πŸš€ Start image=ghcr.io/catthehacker/ubuntu:full-24.04
29+
[CI Tests/Ubuntu GCC 14-5 ] πŸš€ Start image=ghcr.io/catthehacker/ubuntu:full-24.04
30+
[CI Tests/Ubuntu GCC 13-4 ] πŸš€ Start image=ghcr.io/catthehacker/ubuntu:full-24.04
31+
...
32+
33+
```

β€Žsrc/Beman/Optional26/CMakeLists.txtβ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ target_link_libraries(optional_test gtest)
4848
target_link_libraries(optional_test gtest_main)
4949

5050
include(GoogleTest)
51-
gtest_discover_tests(optional_test)
51+
52+
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some platforms.
53+
# Temporary switch to gtest_add_tests and skip some Asan checks.
54+
enable_testing()
55+
gtest_add_tests(optional_test "" AUTO)

0 commit comments

Comments
Β (0)