Skip to content

Commit

Permalink
Set std versions for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Dec 13, 2023
1 parent bddcfdc commit f266555
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ jobs:
build: [Debug, Release]
os: [macos-latest, ubuntu-latest]
compiler: [g++, clang++]
flags: [-std=c++17, -std=c++20]
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} ${{matrix.flags}}
std_version: [17, 20]
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} std:${{matrix.std_version}}
env:
CXX: ${{ matrix.compiler }}
CXXFLAGS: ${{ matrix.flags }}
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v3
- name: cmake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build}}
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build}} -DCMAKE_CXX_STANDARD=${{matrix.std_version}}
- name: build
run: cmake --build build --config ${{matrix.build}} --parallel 4
- name: test
Expand All @@ -32,15 +31,14 @@ jobs:
build: [ Debug, Release ]
os: [ windows-2019, windows-latest ]
arch: [ Win32, x64 ]
flags: [ "/std:c++17", "/std:c++latest" ]
name: ${{matrix.os}} ${{matrix.arch}} ${{matrix.build}} ${{matrix.flags}}
std_version: [17, 20]
name: ${{matrix.os}} ${{matrix.arch}} ${{matrix.build}} std:${{matrix.std_version}}
env:
CXXFLAGS: ${{ matrix.flags }}
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v3
- name: cmake
run: cmake -S . -B build -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.build}}
run: cmake -S . -B build -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.build}} -DCMAKE_CXX_STANDARD=${{matrix.std_version}}
- name: build
run: cmake --build build --config ${{matrix.build}} --parallel 4
- name: test
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sanitize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
os: [ ubuntu-latest ]
compiler: [ clang++ ]
flags:
- "-fsanitize=leak -g -O1 -fno-omit-frame-pointer" #LSAN
- "-fsanitize=address -g -O1 -fno-omit-frame-pointer" #ASAN
- "-fsanitize=thread -g -O1 -fno-omit-frame-pointer" #TSAN
- "-fsanitize=undefined -fno-omit-frame-pointer" #UBSAN
- "-fsanitize=leak -g -O1 -fno-omit-frame-pointer" #LSAN
- "-fsanitize=address -g -O1 -fno-omit-frame-pointer" #ASAN
- "-fsanitize=thread -g -O1 -fno-omit-frame-pointer" #TSAN
- "-fsanitize=undefined -fno-omit-frame-pointer" #UBSAN
name: ${{matrix.os}} ${{matrix.compiler}} ${{matrix.build}} ${{matrix.flags}}
env:
CXX: ${{ matrix.compiler }}
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.14)
project(semver LANGUAGES CXX VERSION 0.3.3)

set(CMAKE_CXX_STANDARD 17)

set(TOP_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(TOP_PROJECT ON)
Expand Down Expand Up @@ -31,6 +29,8 @@ target_include_directories(
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)

## --------------------------------------------------------------------
## TESTS
## --------------------------------------------------------------------
Expand Down

0 comments on commit f266555

Please # to comment.