Skip to content

Commit 3a3b08d

Browse files
committed
Merge branch 'main' into develop
2 parents a3c8b26 + 2c18452 commit 3a3b08d

18 files changed

Lines changed: 194 additions & 112 deletions

.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/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
# Check for updates to GitHub Actions every week
10+
interval: "weekly"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ jobs:
66
runs-on: ubuntu-latest
77

88
steps:
9-
- uses: actions/checkout@v3
10-
- uses: DoozyX/clang-format-lint-action@v0.13
9+
- uses: actions/checkout@v6
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
17-
- uses: EndBug/add-and-commit@v4
17+
- uses: EndBug/add-and-commit@v9
1818
with:
1919
author_name: Clang Robot
2020
author_email: robot@example.com

.github/workflows/ci.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ 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

1717
jobs:
1818
Test:
19+
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build_type}} ${{matrix.packaging_maintainer_mode == 'ON' && '(maintainer mode)' || ''}}
1920
runs-on: ${{ matrix.os }}
2021
strategy:
2122
fail-fast: false
@@ -29,13 +30,13 @@ jobs:
2930
# and your own projects needs
3031
matrix:
3132
os:
32-
- ubuntu-20.04
33-
- macos-10.15
34-
- windows-2019
33+
- ubuntu-latest
34+
- macos-latest
35+
- windows-latest
3536
compiler:
3637
# you can specify the version after `-` like "llvm-15.0.2".
37-
- llvm-15.0.2
38-
- gcc-11
38+
- llvm-19.1.1
39+
- gcc-14
3940
generator:
4041
- "Ninja Multi-Config"
4142
build_type:
@@ -49,66 +50,66 @@ jobs:
4950

5051
exclude:
5152
# mingw is determined by this author to be too buggy to support
52-
- os: windows-2019
53-
compiler: gcc-11
53+
- os: windows-latest
54+
compiler: gcc-14
5455

5556
include:
5657
# Add appropriate variables for gcov version required. This will intentionally break
5758
# if you try to use a compiler that does not have gcov set
58-
- compiler: gcc-11
59-
gcov_executable: gcov
59+
- compiler: gcc-14
60+
gcov_executable: gcov-14
6061
enable_ipo: On
6162

62-
- compiler: llvm-15.0.2
63+
- compiler: llvm-19.1.1
6364
enable_ipo: Off
6465
gcov_executable: "llvm-cov gcov"
6566

66-
- os: macos-10.15
67+
- os: macos-latest
6768
enable_ipo: Off
6869

6970
# Set up preferred package generators, for given build configurations
7071
- build_type: Release
71-
packaging_maintainer_mode: OFF
72+
packaging_maintainer_mode: On
7273
package_generator: TBZ2
7374

7475
# This exists solely to make sure a non-multiconfig build works
75-
- os: ubuntu-20.04
76-
compiler: gcc-11
76+
- os: ubuntu-latest
77+
compiler: gcc-14
7778
generator: "Unix Makefiles"
7879
build_type: Debug
79-
gcov_executable: gcov
80+
gcov_executable: gcov-14
8081
packaging_maintainer_mode: On
8182
enable_ipo: Off
8283

8384
# Windows msvc builds
84-
- os: windows-2022
85+
- os: windows-latest
8586
compiler: msvc
8687
generator: "Visual Studio 17 2022"
8788
build_type: Debug
8889
packaging_maintainer_mode: On
8990
enable_ipo: On
9091

91-
- os: windows-2022
92+
- os: windows-latest
9293
compiler: msvc
9394
generator: "Visual Studio 17 2022"
9495
build_type: Release
9596
packaging_maintainer_mode: On
9697
enable_ipo: On
9798

98-
- os: windows-2022
99+
- os: windows-latest
99100
compiler: msvc
100101
generator: "Visual Studio 17 2022"
101102
build_type: Debug
102103
packaging_maintainer_mode: Off
103104

104-
- os: windows-2022
105+
- os: windows-latest
105106
compiler: msvc
106107
generator: "Visual Studio 17 2022"
107108
build_type: Release
108109
packaging_maintainer_mode: Off
109110
package_generator: ZIP
110111

111-
- os: windows-2022
112+
- os: windows-latest
112113
compiler: msvc
113114
generator: "Visual Studio 17 2022"
114115
build_type: Release
@@ -120,12 +121,12 @@ jobs:
120121
steps:
121122
- name: Check for llvm version mismatches
122123
if: ${{ contains(matrix.compiler, 'llvm') && !contains(matrix.compiler, env.CLANG_TIDY_VERSION) }}
123-
uses: actions/github-script@v3
124+
uses: actions/github-script@v8
124125
with:
125126
script: |
126127
core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen')
127128
128-
- uses: actions/checkout@v3
129+
- uses: actions/checkout@v6
129130

130131
- name: Setup Cache
131132
uses: ./.github/actions/setup_cache
@@ -175,7 +176,7 @@ jobs:
175176
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
176177
run: |
177178
ctest -C ${{matrix.build_type}}
178-
gcovr -j ${{env.nproc}} --delete --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}'
179+
gcovr -j ${{env.nproc}} --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}'
179180
180181
- name: Windows - Test and coverage
181182
if: runner.os == 'Windows'
@@ -190,16 +191,18 @@ jobs:
190191
cpack -C ${{matrix.build_type}} -G ${{matrix.package_generator}}
191192
192193
- name: Publish Tagged Release
193-
uses: softprops/action-gh-release@v1
194+
uses: softprops/action-gh-release@v2
194195
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.package_generator != '' }}
195196
with:
196197
files: |
197198
build/*-*${{ matrix.build_type }}*-*.*
198199
199200
200201
- name: Publish to codecov
201-
uses: codecov/codecov-action@v2
202+
uses: codecov/codecov-action@v5
202203
with:
204+
fail_ci_if_error: true # we weren't posting previously
203205
flags: ${{ runner.os }}
204206
name: ${{ runner.os }}-coverage
207+
token: ${{ secrets.CODECOV_TOKEN }}
205208
files: ./build/coverage.xml

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
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:
@@ -48,7 +48,7 @@ jobs:
4848

4949

5050
steps:
51-
- uses: actions/checkout@v3
51+
- uses: actions/checkout@v6
5252

5353
- name: Setup Cache
5454
uses: ./.github/actions/setup_cache
@@ -89,7 +89,7 @@ jobs:
8989
9090
# Initializes the CodeQL tools for scanning.
9191
- name: Initialize CodeQL
92-
uses: github/codeql-action/init@v2
92+
uses: github/codeql-action/init@v4
9393
with:
9494
languages: ${{ matrix.language }}
9595
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -104,4 +104,4 @@ jobs:
104104
cmake --build ./build --config ${{matrix.build_type}}
105105
106106
- name: Perform CodeQL Analysis
107-
uses: github/codeql-action/analyze@v2
107+
uses: github/codeql-action/analyze@v4

.github/workflows/template-janitor.yml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ 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:
37-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v6
3838

3939
- name: Setup Cache
4040
uses: ./.github/actions/setup_cache
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,23 +53,47 @@ 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

60+
- name: Export description to variable
61+
# This is basically needed as we have to have the value in an env variable to further process it in a safe manner.
62+
# Also we can inject a mock-string for testing if the project is still the template.
63+
if: fromJson(steps.get_repo_meta.outputs.data).is_template == false
64+
run: |
65+
# description can contain characters that mess with the sed command, so store it in a variable first.
66+
# The content of the description will be copied as-is by the action which makes it nearly impossible to "just" use it.
67+
# But by storing it in a variable with a heredoc the sed command will accept quotes and single quotes without a problem.
68+
# The heredoc delimiter is deliberately verbose and complex to reduce the likeliness someone accidentally puts it in their
69+
# description.
70+
echo NEW_DESCRIPTION="$(cat <<'do;not(include}this[in%the$description'
71+
${{ fromJson(steps.get_repo_meta.outputs.data).description }}
72+
do;not(include}this[in%the$description
73+
)" >> $GITHUB_ENV
74+
6275
- name: Use testing variables if still a template
6376
if: fromJson(steps.get_repo_meta.outputs.data).is_template == true
6477
run: |
6578
# This name is unsafe because it is not a valid C++ identifier
6679
echo "NEW_PROJECT=my-unsafe.project" >> $GITHUB_ENV
80+
# This name is unsafe as the sed command later uses surrounding quotes and the pipe symbol. The other characters are generally harmful too.
81+
NEW_DESCRIPTION=$(cat <<'EOF'
82+
Unsafe because of "quotes" and unbalanced "quotes ('Also' 'unbalanced single). The sed uses | and used to have /. Variable expansion might be bad $GITHUB_ENV as well. Also \ should stay.
83+
EOF
84+
)
85+
echo NEW_DESCRIPTION="$NEW_DESCRIPTION" >> $GITHUB_ENV
6786
6887
- name: Add safe replacement variable versions
6988
run: |
7089
# hyphens and dots in c++ identifiers are forbidden. Use underscores instead.
7190
NEW_SAFE_PROJECT=$(echo ${{ env.NEW_PROJECT }} | sed "s/-/_/g" | sed "s/\./_/g" )
72-
echo "NEW_SAFE_PROJECT=$NEW_SAFE_PROJECT" >> $GITHUB_ENV
91+
echo "NEW_SAFE_PROJECT=$NEW_SAFE_PROJECT" >> $GITHUB_ENV
92+
# The sed command uses the pipe as the delimiter so escape that to make it safe.
93+
# Also as we would remove any literal \ we have to escape those aswell and that has to
94+
# be done first as it would mess with the escape for the | otherwise.
95+
NEW_SAFE_DESCRIPTION="$(echo "$NEW_DESCRIPTION" | sed 's/\\/\\\\/g' | sed 's/|/\\|/g' )"
96+
echo "NEW_SAFE_DESCRIPTION=$NEW_SAFE_DESCRIPTION" >> $GITHUB_ENV
7397
7498
# Rename all cpp_starter_project occurences to current repository and remove this workflow
7599
- name: Insert new org and project
@@ -83,7 +107,8 @@ jobs:
83107
# fill in placeholders of readme and move it into place
84108
sed -i "s/%%myorg%%/${{ env.NEW_ORG }}/g" ${{ env.TEMPLATES_PATH }}/README.md
85109
sed -i "s/%%myproject%%/${{ env.NEW_PROJECT }}/g" ${{ env.TEMPLATES_PATH }}/README.md
86-
sed -i "s|%%description%%|${{ fromJson(steps.get_repo_meta.outputs.data).description }}|g" ${{ env.TEMPLATES_PATH }}/README.md
110+
# Use the variable from the env directly as githubs expansion would break the sed command.
111+
sed -i "s|%%description%%|$NEW_SAFE_DESCRIPTION|g" ${{ env.TEMPLATES_PATH }}/README.md
87112
mv include/myproject include/${{ env.NEW_SAFE_PROJECT }}
88113
cp ${{ env.TEMPLATES_PATH }}/README.md README.md
89114
@@ -161,18 +186,18 @@ jobs:
161186
- "Unix Makefiles"
162187
build_type:
163188
- Debug
164-
developer_mode:
165-
- OFF
189+
packaging_maintainer_mode:
190+
- ON
166191

167192
steps:
168-
- uses: actions/checkout@v3
193+
- uses: actions/checkout@v6
169194

170195
- name: Setup Cache
171196
uses: ./.github/actions/setup_cache
172197
with:
173198
compiler: ${{ matrix.compiler }}
174199
build_type: ${{ matrix.build_type }}
175-
developer_mode: ${{ matrix.developer_mode }}
200+
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
176201
generator: ${{ matrix.generator }}
177202

178203
- name: Get organization and project name
@@ -187,9 +212,7 @@ jobs:
187212
- uses: octokit/request-action@v2.x
188213
id: get_repo_meta
189214
with:
190-
route: GET /repos/{owner}/{repo}
191-
owner: ${{ env.NEW_ORG }}
192-
repo: ${{ env.NEW_PROJECT }}
215+
route: GET /repos/${{ env.NEW_ORG }}/${{ env.NEW_PROJECT }}
193216
env:
194217
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
195218

@@ -230,7 +253,7 @@ jobs:
230253
opencppcoverage: false
231254

232255

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

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)

0 commit comments

Comments
 (0)