Skip to content

Commit c5c9c7b

Browse files
committed
Update ci build scripts
build on OS-latest with newest setup-cpp version ymllint all files Fix typos and strip WS Add path to gcovr Use setup-cpp v0.35.2
1 parent 759d718 commit c5c9c7b

File tree

6 files changed

+271
-94
lines changed

6 files changed

+271
-94
lines changed

.CMakeUserPresets.json

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
{
2+
"version": 6,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 26,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "default-config",
11+
"hidden": true,
12+
"generator": "Ninja",
13+
"cacheVariables": {
14+
"CMAKE_HOST_SYSTEM_PROCESSOR": "$penv{PROCESSOR_ARCHITECTURE}"
15+
}
16+
},
17+
{
18+
"name": "common-config",
19+
"description": "Settings for all toolchains",
20+
"hidden": true,
21+
"inherits": "default-config",
22+
"binaryDir": "${sourceDir}/out/build/${presetName}",
23+
"installDir": "${sourceDir}/out/install/${presetName}",
24+
"cacheVariables": {
25+
"ENABLE_DOXYGEN": false,
26+
"ENABLE_CPPCHECK": false,
27+
"ENABLE_CLANG_TIDY": false
28+
},
29+
"vendor": {
30+
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
31+
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
32+
}
33+
}
34+
},
35+
{
36+
"name": "debug",
37+
"displayName": "Debug",
38+
"description": "Debug build type",
39+
"inherits": "conf-unixlike-common",
40+
"cacheVariables": {
41+
"CMAKE_SKIP_INSTALL_RULES": true,
42+
"CMAKE_BUILD_TYPE": "Debug",
43+
"myproject_ENABLE_COVERAGE": true
44+
}
45+
},
46+
{
47+
"name": "release",
48+
"displayName": "Release",
49+
"description": "Release build type",
50+
"inherits": "conf-unixlike-common",
51+
"cacheVariables": {
52+
"CMAKE_BUILD_TYPE": "Release",
53+
"ENABLE_DOXYGEN": true
54+
}
55+
}
56+
],
57+
"testPresets": [
58+
{
59+
"name": "common-test",
60+
"description":
61+
"Test CMake settings that apply to all configurations",
62+
"hidden": true,
63+
"output": {
64+
"outputOnFailure": true
65+
},
66+
"execution": {
67+
"noTestsAction": "error",
68+
"stopOnFailure": true
69+
}
70+
},
71+
{
72+
"name": "debug",
73+
"displayName": "Strict",
74+
"description": "Enable output and stop on failure",
75+
"inherits": "common-test",
76+
"configuration": "Debug",
77+
"configurePreset": "debug"
78+
},
79+
{
80+
"name": "release",
81+
"displayName": "Strict",
82+
"description": "Enable output and stop on failure",
83+
"inherits": "common-test",
84+
"configuration": "Release",
85+
"configurePreset": "release"
86+
}
87+
],
88+
"buildPresets": [
89+
{
90+
"name": "release",
91+
"configurePreset": "release"
92+
},
93+
{
94+
"name": "install",
95+
"configurePreset": "release",
96+
"targets": [
97+
"install"
98+
]
99+
},
100+
{
101+
"name": "doxygen-docs",
102+
"configurePreset": "release",
103+
"targets": [
104+
"doxygen-docs"
105+
]
106+
},
107+
{
108+
"name": "debug",
109+
"configurePreset": "debug"
110+
}
111+
],
112+
"packagePresets": [
113+
{
114+
"name": "release",
115+
"configurePreset": "release",
116+
"generators": [
117+
"TGZ"
118+
]
119+
}
120+
],
121+
"workflowPresets": [
122+
{
123+
"description": "Developer workflow without installation",
124+
"name": "debug",
125+
"steps": [
126+
{
127+
"type": "configure",
128+
"name": "debug"
129+
},
130+
{
131+
"type": "build",
132+
"name": "debug"
133+
},
134+
{
135+
"type": "test",
136+
"name": "debug"
137+
}
138+
]
139+
},
140+
{
141+
"description": "Release workflow without test",
142+
"name": "release",
143+
"steps": [
144+
{
145+
"name": "release",
146+
"type": "configure"
147+
},
148+
{
149+
"name": "release",
150+
"type": "build"
151+
},
152+
{
153+
"name": "release",
154+
"type": "test"
155+
},
156+
{
157+
"name": "install",
158+
"type": "build"
159+
},
160+
{
161+
"name": "release",
162+
"type": "package"
163+
}
164+
]
165+
}
166+
]
167+
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
extensions: 'h,cpp,hpp'
1515
clangFormatVersion: 12
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: [email protected]

.github/workflows/ci.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
env:
1313
CLANG_TIDY_VERSION: "15.0.2"
14+
CPM_SOURCE_CACHE: ~/.cache/CPM
1415
VERBOSE: 1
1516

1617

@@ -29,9 +30,9 @@ 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-2022
3536
compiler:
3637
# you can specify the version after `-` like "llvm-15.0.2".
3738
- llvm-15.0.2
@@ -49,21 +50,21 @@ jobs:
4950

5051
exclude:
5152
# mingw is determined by this author to be too buggy to support
52-
- os: windows-2019
53+
- os: windows-2022
5354
compiler: gcc-11
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
5859
- compiler: gcc-11
59-
gcov_executable: gcov
60+
gcov_executable: gcov-11
6061
enable_ipo: On
6162

6263
- compiler: llvm-15.0.2
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
@@ -72,11 +73,11 @@ jobs:
7273
package_generator: TBZ2
7374

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

.github/workflows/codeql-analysis.yml

+57-57
Original file line numberDiff line numberDiff line change
@@ -48,60 +48,60 @@ jobs:
4848

4949

5050
steps:
51-
- uses: actions/checkout@v3
52-
53-
- name: Setup Cache
54-
uses: ./.github/actions/setup_cache
55-
with:
56-
compiler: ${{ matrix.compiler }}
57-
build_type: ${{ matrix.build_type }}
58-
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
59-
generator: ${{ matrix.generator }}
60-
61-
- name: Project Name
62-
uses: cardinalby/export-env-action@v2
63-
with:
64-
envFile: '.github/constants.env'
65-
66-
67-
- name: Setup Cpp
68-
uses: aminya/setup-cpp@v1
69-
with:
70-
compiler: ${{ matrix.compiler }}
71-
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
72-
73-
cmake: true
74-
ninja: true
75-
vcpkg: false
76-
ccache: true
77-
clangtidy: false
78-
79-
cppcheck: false
80-
81-
gcovr: false
82-
opencppcoverage: false
83-
84-
# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
85-
# has meaningful results
86-
- name: Configure CMake
87-
run: |
88-
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }}
89-
90-
# Initializes the CodeQL tools for scanning.
91-
- name: Initialize CodeQL
92-
uses: github/codeql-action/init@v2
93-
with:
94-
languages: ${{ matrix.language }}
95-
# If you wish to specify custom queries, you can do so here or in a config file.
96-
# By default, queries listed here will override any specified in a config file.
97-
# Prefix the list here with "+" to use these queries and those in the config file.
98-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
99-
100-
101-
- name: Build
102-
# Execute the build. You can specify a specific target with "--target <NAME>"
103-
run: |
104-
cmake --build ./build --config ${{matrix.build_type}}
105-
106-
- name: Perform CodeQL Analysis
107-
uses: github/codeql-action/analyze@v2
51+
- uses: actions/checkout@v3
52+
53+
- name: Setup Cache
54+
uses: ./.github/actions/setup_cache
55+
with:
56+
compiler: ${{ matrix.compiler }}
57+
build_type: ${{ matrix.build_type }}
58+
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
59+
generator: ${{ matrix.generator }}
60+
61+
- name: Project Name
62+
uses: cardinalby/export-env-action@v2
63+
with:
64+
envFile: '.github/constants.env'
65+
66+
67+
- name: Setup Cpp
68+
uses: aminya/setup-cpp@v1
69+
with:
70+
compiler: ${{ matrix.compiler }}
71+
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
72+
73+
cmake: true
74+
ninja: true
75+
vcpkg: false
76+
ccache: true
77+
clangtidy: false
78+
79+
cppcheck: false
80+
81+
gcovr: false
82+
opencppcoverage: false
83+
84+
# make sure coverage is only enabled for Debug builds, since it sets -O0 to make sure coverage
85+
# has meaningful results
86+
- name: Configure CMake
87+
run: |
88+
cmake -S . -B ./build -G "${{matrix.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }}
89+
90+
# Initializes the CodeQL tools for scanning.
91+
- name: Initialize CodeQL
92+
uses: github/codeql-action/init@v2
93+
with:
94+
languages: ${{ matrix.language }}
95+
# If you wish to specify custom queries, you can do so here or in a config file.
96+
# By default, queries listed here will override any specified in a config file.
97+
# Prefix the list here with "+" to use these queries and those in the config file.
98+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
99+
100+
101+
- name: Build
102+
# Execute the build. You can specify a specific target with "--target <NAME>"
103+
run: |
104+
cmake --build ./build --config ${{matrix.build_type}}
105+
106+
- name: Perform CodeQL Analysis
107+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)