Skip to content

Commit a863ad5

Browse files
committed
Add CMake Workflow Presets
Update used tools versions on CI build
1 parent b559809 commit a863ad5

File tree

4 files changed

+78
-23
lines changed

4 files changed

+78
-23
lines changed

.github/workflows/cmake.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- master
77
- develop
8-
- feature/*
8+
# - feature/*
99

1010
pull_request:
1111
branches:
@@ -19,15 +19,15 @@ jobs:
1919
- uses: actions/checkout@v4
2020

2121
- uses: actions/setup-python@v5
22-
with: {python-version: "3.8"}
22+
with: {python-version: "3.10"}
2323

2424
- name: Install codespell
2525
run: pip3 install codespell
2626

2727
- name: Lint
2828
if: always()
2929
working-directory: asio
30-
run: cmake -D FORMAT_COMMAND=clang-format-14 -P cmake/lint.cmake || echo ignored
30+
run: cmake -D FORMAT_COMMAND=clang-format-15 -P cmake/lint.cmake || echo ignored
3131

3232
- name: Spell check
3333
if: always()
@@ -43,8 +43,7 @@ jobs:
4343
# edit the "<name>" placeholder to your GitHub name.
4444
# If you do not wish to use codecov, then simply delete this job from the
4545
# workflow.
46-
if: github.repository_owner == '<name>'
47-
&& false
46+
if: github.repository_owner == 'ClausKlein'
4847

4948
steps:
5049
- uses: actions/checkout@v4
@@ -70,7 +69,7 @@ jobs:
7069
run: cmake --build build/coverage -t coverage
7170

7271
- name: Submit to codecov.io
73-
uses: codecov/codecov-action@v3
72+
uses: codecov/codecov-action@v4
7473
with:
7574
file: build/coverage/coverage.info
7675

@@ -79,7 +78,7 @@ jobs:
7978

8079
runs-on: ubuntu-22.04
8180

82-
env: {CXX: clang++-14}
81+
env: {CXX: clang++-15}
8382

8483
steps:
8584
- uses: actions/checkout@v4
@@ -118,11 +117,11 @@ jobs:
118117
- name: Install static analyzers
119118
if: matrix.os == 'ubuntu-22.04'
120119
run: >-
121-
sudo apt-get install clang-tidy-14 cppcheck -y -q
120+
sudo apt-get install clang-tidy-15 cppcheck -y -q
122121
123122
sudo update-alternatives --install
124123
/usr/bin/clang-tidy clang-tidy
125-
/usr/bin/clang-tidy-14 140
124+
/usr/bin/clang-tidy-15 150
126125
127126
- name: Setup MultiToolTask
128127
if: matrix.os == 'windows-2022'
@@ -166,14 +165,13 @@ jobs:
166165
# simply delete this job similarly to the coverage one.
167166
if: github.ref == 'refs/heads/master'
168167
&& github.event_name == 'push'
169-
&& github.repository_owner == '<name>'
170-
&& false
168+
&& github.repository_owner == 'ClausKlein'
171169

172170
steps:
173171
- uses: actions/checkout@v4
174172

175173
- uses: actions/setup-python@v5
176-
with: {python-version: "3.8"}
174+
with: {python-version: "3.10"}
177175

178176
- name: Install m.css dependencies
179177
run: pip3 install jinja2 Pygments

asio/CMakePresets.json

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"version": 2,
2+
"version": 3,
33
"cmakeMinimumRequired": {
44
"major": 3,
5-
"minor": 14,
5+
"minor": 21,
66
"patch": 0
77
},
88
"configurePresets": [
@@ -59,19 +59,29 @@
5959
"hidden": true,
6060
"cacheVariables": {
6161
"CMAKE_CXX_FLAGS":
62-
"-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast",
62+
"-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection -Wall -Wextra -Wpedantic -Wno-conversion -Wno-sign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast",
6363
"CMAKE_EXE_LINKER_FLAGS":
6464
"-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now",
6565
"CMAKE_SHARED_LINKER_FLAGS":
6666
"-Wl,--allow-shlib-undefined,--as-needed,-z,noexecstack,-z,relro,-z,now"
67+
},
68+
"condition": {
69+
"type": "equals",
70+
"lhs": "${hostSystemName}",
71+
"rhs": "Linux"
6772
}
6873
},
6974
{
7075
"name": "flags-darwin",
7176
"hidden": true,
7277
"cacheVariables": {
7378
"CMAKE_CXX_FLAGS":
74-
"-fstack-protector-strong -fcf-protection=full -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast"
79+
"-fstack-protector-strong -fcf-protection=full -Wall -Wextra -Wpedantic -Wno-conversion -Wno-sign-conversion -Wcast-qual -Wformat=2 -Wundef -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast"
80+
},
81+
"condition": {
82+
"type": "equals",
83+
"lhs": "${hostSystemName}",
84+
"rhs": "Darwin"
7585
}
7686
},
7787
{
@@ -83,6 +93,11 @@
8393
"CMAKE_CXX_FLAGS":
8494
"/sdl /guard:cf /utf-8 /diagnostics:caret /w14165 /w44242 /w44254 /w44263 /w34265 /w34287 /w44296 /w44365 /w44388 /w44464 /w14545 /w14546 /w14547 /w14549 /w14555 /w34619 /w34640 /w24826 /w14905 /w14906 /w14928 /w45038 /W4 /permissive- /volatile:iso /Zc:inline /Zc:preprocessor /Zc:enumTypes /Zc:lambda /Zc:__cplusplus /Zc:externConstexpr /Zc:throwingNew /EHsc",
8595
"CMAKE_EXE_LINKER_FLAGS": "/machine:x64 /guard:cf"
96+
},
97+
"condition": {
98+
"type": "equals",
99+
"lhs": "${hostSystemName}",
100+
"rhs": "Windows"
86101
}
87102
},
88103
{
@@ -127,6 +142,7 @@
127142
"cacheVariables": {
128143
"ENABLE_COVERAGE": "ON",
129144
"CMAKE_BUILD_TYPE": "Coverage",
145+
"CMAKE_CONFIGURATION_TYPES": "Coverage;Release;Debug",
130146
"CMAKE_CXX_FLAGS_COVERAGE":
131147
"-Og -g --coverage -fkeep-inline-functions -fkeep-static-functions",
132148
"CMAKE_EXE_LINKER_FLAGS_COVERAGE": "--coverage",
@@ -152,6 +168,7 @@
152168
],
153169
"cacheVariables": {
154170
"CMAKE_BUILD_TYPE": "Sanitize",
171+
"CMAKE_CONFIGURATION_TYPES": "Sanitize;Release;Debug",
155172
"CMAKE_CXX_FLAGS_SANITIZE":
156173
"-O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -fno-common"
157174
}

asio/CMakeUserPresets.json

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"version": 2,
2+
"version": 6,
33
"cmakeMinimumRequired": {
44
"major": 3,
5-
"minor": 14,
5+
"minor": 25,
66
"patch": 0
77
},
88
"configurePresets": [
@@ -73,6 +73,12 @@
7373
"configurePreset": "dev",
7474
"configuration": "Debug",
7575
"jobs": 12
76+
},
77+
{
78+
"name": "verify",
79+
"configurePreset": "dev",
80+
"jobs": 12,
81+
"targets": ["all_verify_interface_header_sets"]
7682
}
7783
],
7884
"testPresets": [
@@ -88,5 +94,41 @@
8894
"noTestsAction": "error"
8995
}
9096
}
97+
],
98+
"packagePresets": [
99+
{
100+
"name": "dev",
101+
"configurePreset": "dev",
102+
"generators": [
103+
"TGZ"
104+
]
105+
}
106+
],
107+
"workflowPresets": [
108+
{
109+
"name": "dev",
110+
"steps": [
111+
{
112+
"type": "configure",
113+
"name": "dev"
114+
},
115+
{
116+
"type": "build",
117+
"name": "dev"
118+
},
119+
{
120+
"type": "build",
121+
"name": "verify"
122+
},
123+
{
124+
"type": "test",
125+
"name": "dev"
126+
},
127+
{
128+
"type": "package",
129+
"name": "dev"
130+
}
131+
]
132+
}
91133
]
92134
}

asio/GNUmakefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
.PHONY: all check clean
22
all: .init
3-
cmake --preset dev
4-
cmake --build --preset dev
5-
ninja -C build/dev all_verify_interface_header_sets
3+
cmake --workflow --preset dev
64

75
check:
86
ninja -C build/dev spell-check
97
ninja -C build/dev format-check
108

119
.init: requirements.txt
12-
pip3 install -U -r requirements.txt
10+
-pip3 install --user --upgrade -r requirements.txt
1311
touch .init
1412

1513
clean:
16-
ninja -C build/dev clean
14+
rm -rf build

0 commit comments

Comments
 (0)