-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (102 loc) · 2.92 KB
/
cmake.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: CMake
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
BUILD_TYPE: Debug
jobs:
build:
name: "C++${{ matrix.std }} ${{ matrix.config.name }} ${{ matrix.build_type }}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
build_type: ["Release", "Debug"]
std: [20, 23]
config:
- {
name: "GCC-12",
os: ubuntu-24.04,
compiler:
{
type: GCC,
version: 12,
cc: "gcc-12",
cxx: "g++-12",
},
conan-config: "",
}
- {
name: "GCC-13",
os: ubuntu-24.04,
compiler:
{
type: GCC,
version: 13,
cc: "gcc-13",
cxx: "g++-13",
},
conan-config: "",
}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Get Apt packages
run: >
sudo apt-get update -y &&
sudo apt-get install -y --no-install-recommends
build-essential
cmake
- name: Set Up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Conan installation
run: |
pip install -U conan
- name: Cache Conan
uses: actions/cache@v4
if: always()
env:
cache-name: cache-conan-data
with:
path: ~/.conan2/p
key: ${{ matrix.config.os }}-{{ matrix.std }}-${{ matrix.config.name }}-${{ matrix.build_type }}-${{ hashFiles('conanfile.txt') }}
- name: Conan Configure
shell: bash
run: |
conan profile detect --force
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.std }}/' ~/.conan2/profiles/default
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
conan profile show -pr default
- name: Conan Install
run: >
conan install conanfile.py
--profile:build=~/.conan2/profiles/default
--profile:host=~/.conan2/profiles/default
--build=missing
--output-folder=build
- name: CMake configuration
run: >
cmake
-B ${{github.workspace}}/build
-S .
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DBUILD_TESTS=ON
--toolchain ${{github.workspace}}/build/conan_toolchain.cmake
- name: CMake build
run: >
cmake
--build ${{github.workspace}}/build
--config ${{ matrix.build_type }}
- name: CMake test
working-directory: ${{github.workspace}}/build
run: >
ctest
-C ${{ matrix.build_type }}
--rerun-failed
--output-on-failure