Skip to content

Commit b1020c4

Browse files
committed
Squashed commit of the following:
commit 4edc99c Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 21:20:33 2023 +0100 Update ci.yml commit c76f76a Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 21:02:58 2023 +0100 Update ci.yml commit 7b2e9ef Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 20:20:25 2023 +0100 Update ci.yml commit 4ca61f9 Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 20:09:22 2023 +0100 Update ci.yml commit 2a17e24 Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 20:08:35 2023 +0100 Update ci.yml commit a80c56f Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 20:01:03 2023 +0100 Update ci.yml commit c6ec016 Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 19:53:54 2023 +0100 Update ci.yml commit a9f2ed0 Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 19:51:31 2023 +0100 Update ci.yml commit cbf9f1a Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 19:40:33 2023 +0100 Update ci.yml commit f266555 Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 19:16:46 2023 +0100 Set std versions for CI commit bddcfdc Author: Peter Csajtai <peter.csajtai@outlook.com> Date: Wed Dec 13 18:13:57 2023 +0100 Fixup test execution
1 parent 240133e commit b1020c4

File tree

4 files changed

+43
-31
lines changed

4 files changed

+43
-31
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,73 @@ name: CPP Semver CI
22
on: [push, pull_request]
33

44
jobs:
5-
unix:
5+
macos:
66
runs-on: ${{matrix.os}}
77
strategy:
88
matrix:
9-
build: [Debug, Release]
10-
os: [macos-latest, ubuntu-latest]
11-
compiler: [g++, clang++]
12-
flags: [-std=c++17, -std=c++2a]
13-
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} ${{matrix.flags}}
9+
os: [ macos-latest ]
10+
build: [ Debug, Release ]
11+
compiler: [ clang++ ]
12+
std_version: [ 17, 20 ]
13+
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} std:${{matrix.std_version}}
1414
env:
15-
CXX: ${{ matrix.compiler }}
16-
CXXFLAGS: ${{ matrix.flags }}
15+
CXX: ${{matrix.compiler}}
1716
CTEST_OUTPUT_ON_FAILURE: 1
1817
steps:
1918
- uses: actions/checkout@v3
2019
- name: cmake
21-
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build}}
20+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build}} -DCMAKE_CXX_STANDARD=${{matrix.std_version}}
2221
- name: build
2322
run: cmake --build build --config ${{matrix.build}} --parallel 4
2423
- name: test
2524
working-directory: build
2625
run: ctest -C ${{matrix.build}} -j4
2726

27+
linux:
28+
runs-on: ${{matrix.os}}
29+
strategy:
30+
matrix:
31+
os: [ ubuntu-latest ]
32+
build: [ Debug, Release ]
33+
compiler: [ g++-11, g++-12, g++-13, clang++-15 ]
34+
std_version: [ 17, 20 ]
35+
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} std:${{matrix.std_version}}
36+
env:
37+
CXX: ${{matrix.compiler}}
38+
CTEST_OUTPUT_ON_FAILURE: 1
39+
steps:
40+
- uses: actions/checkout@v3
41+
- name: cmake
42+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build}} -DCMAKE_CXX_STANDARD=${{matrix.std_version}}
43+
- name: build
44+
run: cmake --build build --config ${{matrix.build}} --parallel 4
45+
- name: test
46+
working-directory: build
47+
run: ctest -C ${{matrix.build}} -j4
48+
2849
windows:
2950
runs-on: ${{matrix.os}}
3051
strategy:
3152
matrix:
3253
build: [ Debug, Release ]
3354
os: [ windows-2019, windows-latest ]
3455
arch: [ Win32, x64 ]
35-
flags: [ "/std:c++17", "/std:c++latest" ]
36-
name: ${{matrix.os}} ${{matrix.arch}} ${{matrix.build}} ${{matrix.flags}}
56+
std_version: [ 17, 20 ]
57+
name: ${{matrix.os}} ${{matrix.arch}} ${{matrix.build}} std:${{matrix.std_version}}
3758
env:
38-
CXXFLAGS: ${{ matrix.flags }}
3959
CTEST_OUTPUT_ON_FAILURE: 1
4060
steps:
4161
- uses: actions/checkout@v3
4262
- name: cmake
43-
run: cmake -S . -B build -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.build}}
63+
run: cmake -S . -B build -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.build}} -DCMAKE_CXX_STANDARD=${{matrix.std_version}}
4464
- name: build
4565
run: cmake --build build --config ${{matrix.build}} --parallel 4
4666
- name: test
4767
working-directory: build
4868
run: ctest -C ${{matrix.build}} -j4
4969

5070
coverage:
51-
needs: [ unix, windows ]
71+
needs: [ macos, linux, windows ]
5272
runs-on: ubuntu-latest
5373
env:
5474
CTEST_OUTPUT_ON_FAILURE: 1

.github/workflows/sanitize.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
os: [ ubuntu-latest ]
1111
compiler: [ clang++ ]
1212
flags:
13-
- "-fsanitize=leak -g -O1 -fno-omit-frame-pointer" #LSAN
14-
- "-fsanitize=address -g -O1 -fno-omit-frame-pointer" #ASAN
15-
- "-fsanitize=thread -g -O1 -fno-omit-frame-pointer" #TSAN
16-
- "-fsanitize=undefined -fno-omit-frame-pointer" #UBSAN
13+
- "-fsanitize=leak -g -O1 -fno-omit-frame-pointer" #LSAN
14+
- "-fsanitize=address -g -O1 -fno-omit-frame-pointer" #ASAN
15+
- "-fsanitize=thread -g -O1 -fno-omit-frame-pointer" #TSAN
16+
- "-fsanitize=undefined -fno-omit-frame-pointer" #UBSAN
1717
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} ${{matrix.flags}}
1818
env:
1919
CXX: ${{ matrix.compiler }}

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
cmake_minimum_required(VERSION 3.14)
22
project(semver LANGUAGES CXX VERSION 0.3.3)
33

4-
set(CMAKE_CXX_STANDARD 17)
5-
64
set(TOP_PROJECT OFF)
75
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
86
set(TOP_PROJECT ON)
@@ -31,6 +29,8 @@ target_include_directories(
3129
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
3230
$<INSTALL_INTERFACE:include>)
3331

32+
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
33+
3434
## --------------------------------------------------------------------
3535
## TESTS
3636
## --------------------------------------------------------------------

test/CMakeLists.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ file(GLOB test-sources CONFIGURE_DEPENDS *.cpp)
1515

1616
include(Catch)
1717

18-
# add c++17 tests
19-
add_executable(${PROJECT_NAME}-tests-17 "${test-sources}")
20-
set_target_properties(${PROJECT_NAME}-tests-17 PROPERTIES CXX_STANDARD 17)
21-
target_link_libraries(${PROJECT_NAME}-tests-17 PRIVATE Catch2::Catch2WithMain ${PROJECT_NAME})
22-
catch_discover_tests(${PROJECT_NAME}-tests-17)
23-
24-
# add c++17 tests
25-
add_executable(${PROJECT_NAME}-tests-20 "${test-sources}")
26-
set_target_properties(${PROJECT_NAME}-tests-20 PROPERTIES CXX_STANDARD 20)
27-
target_link_libraries(${PROJECT_NAME}-tests-20 PRIVATE Catch2::Catch2WithMain ${PROJECT_NAME})
28-
catch_discover_tests(${PROJECT_NAME}-tests-20)
18+
add_executable(${PROJECT_NAME}-tests "${test-sources}")
19+
target_link_libraries(${PROJECT_NAME}-tests PRIVATE Catch2::Catch2WithMain ${PROJECT_NAME})
20+
catch_discover_tests(${PROJECT_NAME}-tests)

0 commit comments

Comments
 (0)