Skip to content

Commit a21a6bd

Browse files
committed
new ci scripts and presets
1 parent ce142df commit a21a6bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+646
-7455
lines changed

.ci/build_coverage.sh

-19
This file was deleted.

.ci/build_darwin.sh

-11
This file was deleted.

.ci/build_linux.sh

-11
This file was deleted.

.ci/build_windows_x64.bat

-19
This file was deleted.

.ci/build_windows_x86.bat

-19
This file was deleted.

.clang-tidy

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
Checks: '-*,
3+
4+
bugprone-*,
5+
6+
clang-analyzer-*,
7+
8+
concurrency-*,
9+
10+
cppcoreguidelines-*,
11+
-cppcoreguidelines-macro-usage,
12+
-cppcoreguidelines-pro-bounds-constant-array-index,
13+
14+
modernize-*,
15+
-modernize-use-auto,
16+
-modernize-use-trailing-return-type,
17+
18+
performance-*,
19+
20+
portability-*,
21+
22+
readability-*,
23+
-readability-identifier-length,
24+
-readability-named-parameter,
25+
-readability-redundant-access-specifiers,
26+
'
27+
...

.github/workflows/coverage.yml

-16
This file was deleted.

.github/workflows/darwin.yml

+14-7
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,22 @@ jobs:
1010
matrix:
1111
config:
1212
# https://github.com/actions/virtual-environments/tree/main/images/macos
13-
- { os: "macos-10.15", xcode: "10.3" }
14-
- { os: "macos-10.15", xcode: "11.7" }
15-
- { os: "macos-10.15", xcode: "12.4" }
13+
- { os: "macos-10.15", xcode: "10.3", arch: "x64" }
14+
- { os: "macos-12", xcode: "14.2", arch: "x64" }
1615
name: "xcode-${{matrix.config.xcode}}"
1716
steps:
18-
- uses: actions/checkout@v2
17+
- name: Setup
18+
run: brew install cmake ninja
19+
- name: Checkout
20+
uses: actions/checkout@v3
1921
with:
20-
submodules: recursive
22+
submodules: true
2123
- name: Select Xcode
2224
run: sudo xcode-select --switch "/Applications/Xcode_${{matrix.config.xcode}}.app"
23-
- name: Build && Test
24-
run: .ci/build_darwin.sh
25+
- name: Build
26+
run: |
27+
cmake --preset macos-${{matrix.config.arch}}
28+
cmake --build --preset macos-${{matrix.config.arch}}-release
29+
- name: Test
30+
run: |
31+
ctest --preset macos-${{matrix.config.arch}}-release

.github/workflows/linux.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ jobs:
1111
config:
1212
# https://github.com/actions/virtual-environments/tree/main/images/linux
1313
- { os: "ubuntu-20.04", cc: "gcc-7", cxx: "g++-7" }
14-
- { os: "ubuntu-20.04", cc: "gcc-8", cxx: "g++-8" }
15-
- { os: "ubuntu-20.04", cc: "gcc-9", cxx: "g++-9" }
16-
- { os: "ubuntu-20.04", cc: "gcc-10", cxx: "g++-10" }
1714
- { os: "ubuntu-20.04", cc: "clang-7", cxx: "clang++-7" }
18-
- { os: "ubuntu-20.04", cc: "clang-8", cxx: "clang++-8" }
19-
- { os: "ubuntu-20.04", cc: "clang-9", cxx: "clang++-9" }
20-
- { os: "ubuntu-20.04", cc: "clang-10", cxx: "clang++-10" }
15+
- { os: "ubuntu-22.04", cc: "gcc-12", cxx: "g++-12" }
16+
- { os: "ubuntu-22.04", cc: "clang-14", cxx: "clang++-14" }
2117
name: "${{matrix.config.cxx}}"
2218
steps:
2319
- name: Setup
24-
run: sudo apt-get -y install "${{matrix.config.cc}}" "${{matrix.config.cxx}}"
20+
run: sudo apt-get -y install cmake ninja-build ${{matrix.config.cc}} ${{matrix.config.cxx}}
2521
- name: Checkout
26-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2723
with:
28-
submodules: recursive
29-
- name: Build && Test
30-
run: .ci/build_linux.sh
31-
env: { CC: "${{matrix.config.cc}}", CXX: "${{matrix.config.cxx}}" }
24+
submodules: true
25+
- name: Build
26+
run: |
27+
cmake --preset linux-${{matrix.config.cc}}
28+
cmake --build --preset linux-${{matrix.config.cc}}-release
29+
- name: Test
30+
run: |
31+
ctest --preset linux-${{matrix.config.cc}}-release

.github/workflows/windows.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,24 @@ jobs:
1010
matrix:
1111
config:
1212
# https://github.com/actions/virtual-environments/tree/main/images/win
13-
- { os: "windows-2016", vs: "Visual Studio 2017", arch: "x86" }
14-
- { os: "windows-2016", vs: "Visual Studio 2017", arch: "x64" }
15-
- { os: "windows-2019", vs: "Visual Studio 2019", arch: "x86" }
16-
- { os: "windows-2019", vs: "Visual Studio 2019", arch: "x64" }
17-
name: "${{matrix.config.vs}} ${{matrix.config.arch}}"
13+
- { os: "windows-2019", vc: "msvc2019", arch: "x86" }
14+
- { os: "windows-2019", vc: "msvc2019", arch: "x64" }
15+
- { os: "windows-2022", vc: "msvc2022", arch: "x86" }
16+
- { os: "windows-2022", vc: "msvc2022", arch: "x64" }
17+
name: "${{matrix.config.vc}} ${{matrix.config.arch}}"
1818
steps:
19-
- uses: actions/checkout@v2
19+
- name: Setup
20+
run: choco install cmake ninja
21+
- name: Checkout
22+
uses: actions/checkout@v3
2023
with:
21-
submodules: recursive
22-
- name: Build && Test
23-
run: .ci\build_windows_${{matrix.config.arch}}.bat
24+
submodules: true
25+
- name: Select MSVC
26+
uses: ilammy/msvc-dev-cmd@v1
27+
- name: Build
28+
run: |
29+
cmake --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}
30+
cmake --build --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release
31+
- name: Test
32+
run: |
33+
ctest --preset windows-${{matrix.config.arch}}-${{matrix.config.vc}}-release

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
build/*
2+
.clangd/*
23
.vscode/*
34
CMakeLists.txt.user

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "vendors/doctest"]
2+
path = vendors/doctest
3+
url = https://github.com/doctest/doctest/

CMakeLists.txt

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# 3.8 version is required for `cxx_std_17`
2-
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
32

43
if(NOT DEFINED PROJECT_NAME)
54
set(BUILD_AS_STANDALONE ON)
@@ -10,27 +9,28 @@ endif()
109
project(flat.hpp)
1110

1211
add_library(${PROJECT_NAME} INTERFACE)
13-
target_include_directories(${PROJECT_NAME} INTERFACE headers)
1412
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)
13+
target_include_directories(${PROJECT_NAME} INTERFACE headers)
1514

16-
target_compile_options(${PROJECT_NAME}
17-
INTERFACE
18-
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
19-
-Wno-c++98-compat-pedantic
20-
-Wno-padded
21-
-Wno-shadow
22-
-Wno-unknown-warning-option>)
23-
24-
if(BUILD_AS_STANDALONE)
25-
option(BUILD_WITH_UNBENCH "Build with benchmarks" OFF)
26-
if(BUILD_WITH_UNBENCH)
27-
enable_testing()
28-
add_subdirectory(unbench)
29-
endif()
30-
31-
option(BUILD_WITH_UNTESTS "Build with unit tests" ON)
32-
if(BUILD_WITH_UNTESTS)
33-
enable_testing()
34-
add_subdirectory(untests)
35-
endif()
15+
#
16+
# BUILD_AS_STANDALONE
17+
#
18+
19+
if(NOT ${BUILD_AS_STANDALONE})
20+
return()
3621
endif()
22+
23+
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
24+
option(BUILD_WITH_SANITIZERS "Build with sanitizers" OFF)
25+
26+
enable_testing()
27+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
28+
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake")
29+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
30+
31+
include(EnableASan)
32+
include(EnableGCov)
33+
include(EnableUBSan)
34+
35+
add_subdirectory(vendors)
36+
add_subdirectory(untests)

0 commit comments

Comments
 (0)