-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (80 loc) · 2.32 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI Builds
on:
push:
paths:
- 'include/**'
- 'tests/**'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- '**conanfile.py'
- '.github/workflows/ci.yml'
pull_request:
jobs:
build_and_test:
runs-on: ${{matrix.os}}
strategy:
matrix:
cpp_compiler: [g++, clang++, cl]
build_type: [Debug]
include:
# GCC
- os: ubuntu-latest
cpp_compiler: g++
build_type: Debug
build_dir: build/Debug
config_preset: tests-ninja-linux-debug
# Clang
- os: ubuntu-latest
cpp_compiler: clang++
build_type: Debug
build_dir: build/Debug
config_preset: tests-ninja-linux-debug
# MSVC
- os: windows-latest
cpp_compiler: cl
build_dir: build
config_preset: tests-msvc2022
defaults:
run:
working-directory: ${{github.workspace}}
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Install CMake and Ninja
uses: lukka/get-cmake@latest
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Configure Conan
run: conan profile detect --force
- name: Install dependencies
run: >
conan install
--build=missing
--settings build_type=${{matrix.build_type}}
--settings compiler.cppstd=17
${{github.workspace}}
- name: Configure CMake
run: >
cmake
-S ${{github.workspace}}
-DCMAKE_CXX_COMPILER=${{matrix.cpp_compiler}}
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/${{matrix.build_dir}}/generators/conan_toolchain.cmake
--preset=${{matrix.config_preset}}
- name: Build
if: matrix.os == 'ubuntu-latest'
run: cmake --build ${{matrix.build_dir}}
- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: >
cmake
--build ${{matrix.build_dir}}
--config ${{matrix.build_type}}
--parallel %NUMBER_OF_PROCESSORS%
shell: cmd
- name: Test
run: >
ctest
--test-dir ${{matrix.build_dir}}
--build-config ${{matrix.build_type}}
--output-on-failure