Skip to content

Commit bf180f6

Browse files
authored
Update Github Actions OS and Compilers
* Upgrade Operating Systems to Latest * Upgrade compilers to Clang 19 and GCC 14 * Fix issues brought up by clang-tidy 19 * Remove a couple of clang-tidy issues I don't think are appropriate for this project * Tweak cppcheck settings
1 parent a7caf06 commit bf180f6

File tree

13 files changed

+123
-77
lines changed

13 files changed

+123
-77
lines changed

.clang-tidy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Checks: "*,
1313
-readability-avoid-const-params-in-decls,
1414
-cppcoreguidelines-non-private-member-variables-in-classes,
1515
-misc-non-private-member-variables-in-classes,
16+
-misc-no-recursion,
17+
-misc-use-anonymous-namespace,
18+
-misc-use-internal-linkage
1619
"
1720
WarningsAsErrors: ''
1821
HeaderFilterRegex: ''

.github/workflows/auto-clang-format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77

88
steps:
99
- uses: actions/checkout@v3
10-
- uses: DoozyX/clang-format-lint-action@v0.13
10+
- uses: DoozyX/clang-format-lint-action@v0.20
1111
with:
1212
source: '.'
1313
exclude: './third_party ./external'
1414
extensions: 'h,cpp,hpp'
15-
clangFormatVersion: 12
15+
clangFormatVersion: 19
1616
inplace: True
1717
- uses: EndBug/add-and-commit@v4
1818
with:

.github/workflows/ci.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- develop
1111

1212
env:
13-
CLANG_TIDY_VERSION: "15.0.2"
13+
CLANG_TIDY_VERSION: "19.1.1"
1414
VERBOSE: 1
1515

1616

@@ -29,13 +29,13 @@ jobs:
2929
# and your own projects needs
3030
matrix:
3131
os:
32-
- ubuntu-20.04
33-
- macos-10.15
34-
- windows-2019
32+
- ubuntu-latest
33+
- macos-latest
34+
- windows-latest
3535
compiler:
3636
# you can specify the version after `-` like "llvm-15.0.2".
37-
- llvm-15.0.2
38-
- gcc-11
37+
- llvm-19.1.1
38+
- gcc-14
3939
generator:
4040
- "Ninja Multi-Config"
4141
build_type:
@@ -49,66 +49,66 @@ jobs:
4949

5050
exclude:
5151
# mingw is determined by this author to be too buggy to support
52-
- os: windows-2019
53-
compiler: gcc-11
52+
- os: windows-latest
53+
compiler: gcc-14
5454

5555
include:
5656
# Add appropriate variables for gcov version required. This will intentionally break
5757
# if you try to use a compiler that does not have gcov set
58-
- compiler: gcc-11
59-
gcov_executable: gcov
58+
- compiler: gcc-14
59+
gcov_executable: gcov-14
6060
enable_ipo: On
6161

62-
- compiler: llvm-15.0.2
62+
- compiler: llvm-19.1.1
6363
enable_ipo: Off
6464
gcov_executable: "llvm-cov gcov"
6565

66-
- os: macos-10.15
66+
- os: macos-latest
6767
enable_ipo: Off
6868

6969
# Set up preferred package generators, for given build configurations
7070
- build_type: Release
71-
packaging_maintainer_mode: OFF
71+
packaging_maintainer_mode: On
7272
package_generator: TBZ2
7373

7474
# This exists solely to make sure a non-multiconfig build works
75-
- os: ubuntu-20.04
76-
compiler: gcc-11
75+
- os: ubuntu-latest
76+
compiler: gcc-14
7777
generator: "Unix Makefiles"
7878
build_type: Debug
79-
gcov_executable: gcov
79+
gcov_executable: gcov-14
8080
packaging_maintainer_mode: On
8181
enable_ipo: Off
8282

8383
# Windows msvc builds
84-
- os: windows-2022
84+
- os: windows-latest
8585
compiler: msvc
8686
generator: "Visual Studio 17 2022"
8787
build_type: Debug
8888
packaging_maintainer_mode: On
8989
enable_ipo: On
9090

91-
- os: windows-2022
91+
- os: windows-latest
9292
compiler: msvc
9393
generator: "Visual Studio 17 2022"
9494
build_type: Release
9595
packaging_maintainer_mode: On
9696
enable_ipo: On
9797

98-
- os: windows-2022
98+
- os: windows-latest
9999
compiler: msvc
100100
generator: "Visual Studio 17 2022"
101101
build_type: Debug
102102
packaging_maintainer_mode: Off
103103

104-
- os: windows-2022
104+
- os: windows-latest
105105
compiler: msvc
106106
generator: "Visual Studio 17 2022"
107107
build_type: Release
108108
packaging_maintainer_mode: Off
109109
package_generator: ZIP
110110

111-
- os: windows-2022
111+
- os: windows-latest
112112
compiler: msvc
113113
generator: "Visual Studio 17 2022"
114114
build_type: Release
@@ -175,7 +175,7 @@ jobs:
175175
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
176176
run: |
177177
ctest -C ${{matrix.build_type}}
178-
gcovr -j ${{env.nproc}} --delete --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}'
178+
gcovr -j ${{env.nproc}} --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}'
179179
180180
- name: Windows - Test and coverage
181181
if: runner.os == 'Windows'

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3939
compiler:
4040
# you can specify the version after `-` like "llvm-13.0.0".
41-
- gcc-11
41+
- gcc-14
4242
generator:
4343
- "Ninja Multi-Config"
4444
build_type:

.github/workflows/template-janitor.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
strategy:
2626
matrix:
2727
compiler:
28-
- gcc-11
28+
- gcc-14
2929
generator:
3030
- "Unix Makefiles"
3131
build_type:
3232
- Debug
33-
developer_mode:
33+
packaging_maintainer_mode:
3434
- OFF
3535

3636
steps:
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
compiler: ${{ matrix.compiler }}
4343
build_type: ${{ matrix.build_type }}
44-
developer_mode: ${{ matrix.developer_mode }}
44+
package_maintainer_mode: ${{ matrix.package_maintainer_mode }}
4545
generator: ${{ matrix.generator }}
4646

4747
- name: Get organization and project name
@@ -53,9 +53,7 @@ jobs:
5353
- uses: octokit/request-action@v2.x
5454
id: get_repo_meta
5555
with:
56-
route: GET /repos/{owner}/{repo}
57-
owner: ${{ env.NEW_ORG }}
58-
repo: ${{ env.NEW_PROJECT }}
56+
route: GET /repos/${{ env.NEW_ORG }}/${{ env.NEW_PROJECT }}
5957
env:
6058
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6159

@@ -161,8 +159,8 @@ jobs:
161159
- "Unix Makefiles"
162160
build_type:
163161
- Debug
164-
developer_mode:
165-
- OFF
162+
packaging_maintainer_mode:
163+
- ON
166164

167165
steps:
168166
- uses: actions/checkout@v3
@@ -172,7 +170,7 @@ jobs:
172170
with:
173171
compiler: ${{ matrix.compiler }}
174172
build_type: ${{ matrix.build_type }}
175-
developer_mode: ${{ matrix.developer_mode }}
173+
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
176174
generator: ${{ matrix.generator }}
177175

178176
- name: Get organization and project name
@@ -187,9 +185,7 @@ jobs:
187185
- uses: octokit/request-action@v2.x
188186
id: get_repo_meta
189187
with:
190-
route: GET /repos/{owner}/{repo}
191-
owner: ${{ env.NEW_ORG }}
192-
repo: ${{ env.NEW_PROJECT }}
188+
route: GET /repos/${{ env.NEW_ORG }}/${{ env.NEW_PROJECT }}
193189
env:
194190
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
195191

@@ -230,7 +226,7 @@ jobs:
230226
opencppcoverage: false
231227

232228

233-
- name: Test simple configuration to make sure nothing broke (default compiler,cmake,developer_mode OFF)
229+
- name: Test simple configuration to make sure nothing broke (default compiler,cmake,packaging_maintainer_mode OFF)
234230
run: |
235231
cmake -S . -B ./build -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build_type }} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=ON
236232

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.21)
66

77
# Only set the cxx_standard if it is not set by someone else
88
if (NOT DEFINED CMAKE_CXX_STANDARD)
9-
set(CMAKE_CXX_STANDARD 20)
9+
set(CMAKE_CXX_STANDARD 23)
1010
endif()
1111

1212
# strongly encouraged to enable this globally to avoid conflicts between
@@ -76,7 +76,7 @@ endif()
7676

7777
if(myproject_BUILD_FUZZ_TESTS)
7878
message(AUTHOR_WARNING "Building Fuzz Tests, using fuzzing sanitizer https://www.llvm.org/docs/LibFuzzer.html")
79-
if (NOT myproject_ENABLE_ADDRESS_SANITIZER AND NOT myproject_ENABLE_THREAD_SANITIZER)
79+
if (NOT myproject_ENABLE_SANITIZER_ADDRESS AND NOT myproject_ENABLE_SANITIZER_THREAD)
8080
message(WARNING "You need asan or tsan enabled for meaningful fuzz testing")
8181
endif()
8282
add_subdirectory(fuzz_test)

Dependencies.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ function(myproject_setup_dependencies)
99
# already been provided to us by a parent project
1010

1111
if(NOT TARGET fmtlib::fmtlib)
12-
cpmaddpackage("gh:fmtlib/fmt#9.1.0")
12+
cpmaddpackage("gh:fmtlib/fmt#11.1.4")
1313
endif()
1414

1515
if(NOT TARGET spdlog::spdlog)
1616
cpmaddpackage(
1717
NAME
1818
spdlog
1919
VERSION
20-
1.11.0
20+
1.15.2
2121
GITHUB_REPOSITORY
2222
"gabime/spdlog"
2323
OPTIONS
2424
"SPDLOG_FMT_EXTERNAL ON")
2525
endif()
2626

2727
if(NOT TARGET Catch2::Catch2WithMain)
28-
cpmaddpackage("gh:catchorg/Catch2@3.3.2")
28+
cpmaddpackage("gh:catchorg/Catch2@3.8.1")
2929
endif()
3030

3131
if(NOT TARGET CLI11::CLI11)
32-
cpmaddpackage("gh:CLIUtils/CLI11@2.3.2")
32+
cpmaddpackage("gh:CLIUtils/CLI11@2.5.0")
3333
endif()
3434

3535
if(NOT TARGET ftxui::screen)
36-
cpmaddpackage("gh:ArthurSonzogni/FTXUI@5.0.0")
36+
cpmaddpackage("gh:ArthurSonzogni/FTXUI@6.0.2")
3737
endif()
3838

3939
if(NOT TARGET tools::tools)

ProjectOptions.cmake

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,53 @@ include(CMakeDependentOption)
44
include(CheckCXXCompilerFlag)
55

66

7+
include(CheckCXXSourceCompiles)
8+
9+
710
macro(myproject_supports_sanitizers)
811
if((CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*" OR CMAKE_CXX_COMPILER_ID MATCHES ".*GNU.*") AND NOT WIN32)
9-
set(SUPPORTS_UBSAN ON)
12+
13+
message(STATUS "Sanity checking UndefinedBehaviorSanitizer, it should be supported on this platform")
14+
set(TEST_PROGRAM "int main() { return 0; }")
15+
16+
# Check if UndefinedBehaviorSanitizer works at link time
17+
set(CMAKE_REQUIRED_FLAGS "-fsanitize=undefined")
18+
set(CMAKE_REQUIRED_LINK_OPTIONS "-fsanitize=undefined")
19+
check_cxx_source_compiles("${TEST_PROGRAM}" HAS_UBSAN_LINK_SUPPORT)
20+
21+
if(HAS_UBSAN_LINK_SUPPORT)
22+
message(STATUS "UndefinedBehaviorSanitizer is supported at both compile and link time.")
23+
set(SUPPORTS_UBSAN ON)
24+
else()
25+
message(WARNING "UndefinedBehaviorSanitizer is NOT supported at link time.")
26+
set(SUPPORTS_UBSAN OFF)
27+
endif()
1028
else()
1129
set(SUPPORTS_UBSAN OFF)
1230
endif()
1331

1432
if((CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*" OR CMAKE_CXX_COMPILER_ID MATCHES ".*GNU.*") AND WIN32)
1533
set(SUPPORTS_ASAN OFF)
1634
else()
17-
set(SUPPORTS_ASAN ON)
35+
if (NOT WIN32)
36+
message(STATUS "Sanity checking AddressSanitizer, it should be supported on this platform")
37+
set(TEST_PROGRAM "int main() { return 0; }")
38+
39+
# Check if AddressSanitizer works at link time
40+
set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
41+
set(CMAKE_REQUIRED_LINK_OPTIONS "-fsanitize=address")
42+
check_cxx_source_compiles("${TEST_PROGRAM}" HAS_ASAN_LINK_SUPPORT)
43+
44+
if(HAS_ASAN_LINK_SUPPORT)
45+
message(STATUS "AddressSanitizer is supported at both compile and link time.")
46+
set(SUPPORTS_ASAN ON)
47+
else()
48+
message(WARNING "AddressSanitizer is NOT supported at link time.")
49+
set(SUPPORTS_ASAN OFF)
50+
endif()
51+
else()
52+
set(SUPPORTS_ASAN ON)
53+
endif()
1854
endif()
1955
endmacro()
2056

cmake/CPM.cmake

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
set(CPM_DOWNLOAD_VERSION 0.38.1)
1+
# SPDX-License-Identifier: MIT
2+
#
3+
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors
4+
5+
set(CPM_DOWNLOAD_VERSION 0.40.8)
6+
set(CPM_HASH_SUM "78ba32abdf798bc616bab7c73aac32a17bbd7b06ad9e26a6add69de8f3ae4791")
27

38
if(CPM_SOURCE_CACHE)
49
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
@@ -11,23 +16,9 @@ endif()
1116
# Expand relative path. This is important if the provided path contains a tilde (~)
1217
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
1318

14-
function(download_cpm)
15-
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
16-
file(DOWNLOAD
17-
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
18-
${CPM_DOWNLOAD_LOCATION}
19-
)
20-
endfunction()
21-
22-
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
23-
download_cpm()
24-
else()
25-
# resume download if it previously failed
26-
file(READ ${CPM_DOWNLOAD_LOCATION} check)
27-
if("${check}" STREQUAL "")
28-
download_cpm()
29-
endif()
30-
unset(check)
31-
endif()
19+
file(DOWNLOAD
20+
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
21+
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
22+
)
3223

3324
include(${CPM_DOWNLOAD_LOCATION})

cmake/StaticAnalyzers.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ macro(myproject_enable_cppcheck WARNINGS_AS_ERRORS CPPCHECK_OPTIONS)
2828
# ignores code that cppcheck thinks is invalid C++
2929
--suppress=syntaxError
3030
--suppress=preprocessorErrorDirective
31+
# ignores static_assert type failures
32+
--suppress=knownConditionTrueFalse
3133
--inconclusive
3234
--suppress=${SUPPRESS_DIR})
3335
else()

0 commit comments

Comments
 (0)