-
Notifications
You must be signed in to change notification settings - Fork 93
277 lines (251 loc) · 8.65 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# See runners details:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software
name: CI
on:
push:
branches: ["master", "0.7-dev"]
pull_request:
jobs:
Build-Windows:
# The type of runner that the job will run on
name: ${{ matrix.config.name }} (${{ matrix.build_type }}, ${{ matrix.config.cxx }}, C++${{ matrix.cppstd }})
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: "Windows Latest MSVC"
# https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
os: windows-latest
cc: "cl"
cxx: "cl"
generator: "Visual Studio 17 2022"
build_type:
- Release
- Debug
cppstd:
- 17
- 20
env:
CXX: ${{ matrix.config.cxx }}
RESTINIO_BUILD_DIR: _build_${{ matrix.config.cxx }}_cppstd${{ matrix.cppstd }}_${{ matrix.build_type }}
steps:
- uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies
run: |
gem install Mxx_ru
- name: Configure
shell: bash
run: |
mxxruexternals
cd dev
cmake \
-B $RESTINIO_BUILD_DIR \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.cppstd }} \
-DRESTINIO_TEST_SUFFIX=" [cpp${{ matrix.cppstd }}_${{ matrix.build_type }}]" \
-G "${{ matrix.config.generator }}"
- name: Build
working-directory: ./dev
shell: bash
run: |
cmake \
--build $RESTINIO_BUILD_DIR \
--config ${{ matrix.build_type }} \
--parallel ${NUMBER_OF_PROCESSORS} \
--verbose
- name: Test
shell: bash
working-directory: ./dev
run: |
ctest \
-T test \
-C ${{ matrix.build_type }} \
--test-dir $RESTINIO_BUILD_DIR \
--output-on-failure \
--no-compress-output
Build-Linux:
# The type of runner that the job will run on
name: Ubuntu-22.04 (${{ matrix.build_settings.toolset }}-${{ matrix.build_settings.toolset_version }}, ${{ matrix.build_type }}, C++${{ matrix.build_settings.cppstd }}, ${{matrix.build_settings.asio_source}} asio)
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build_settings:
- toolset: gcc
toolset_version: 9
cppstd: 17
asio_source: standalone
- toolset: gcc
toolset_version: 9
cppstd: 17
asio_source: boost
- toolset: gcc
toolset_version: 9
cppstd: 17
asio_source: boost-system-package
- toolset: gcc
toolset_version: 12
cppstd: 17
asio_source: standalone
- toolset: gcc
toolset_version: 12
cppstd: 20
asio_source: standalone
- toolset: gcc
toolset_version: 12
cppstd: 20
asio_source: boost
- toolset: clang
toolset_version: 13
cppstd: 17
asio_source: standalone
- toolset: clang
toolset_version: 15
cppstd: 17
asio_source: standalone
- toolset: clang
toolset_version: 15
cppstd: 20
asio_source: standalone
build_type:
- Release
- Debug
env:
RESTINIO_BUILD_TAG: ${{ matrix.build_settings.toolset }}-${{ matrix.build_settings.toolset_version }}_cpp${{ matrix.build_settings.cppstd }}_${{ matrix.build_type }}_${{matrix.build_settings.asio_source}}_asio
steps:
- uses: actions/checkout@v3
- name: Prepare env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
echo "RESTINIO_BUILD_DIR=_build_${RESTINIO_BUILD_TAG}" >> $GITHUB_ENV
echo "CC=${{ matrix.build_settings.toolset }}-${{ matrix.build_settings.toolset_version }}" >> $GITHUB_ENV
if [ "${{ matrix.build_settings.toolset }}" == "gcc" ]; then
echo "CXX=g++-${{ matrix.build_settings.toolset_version }}" >> $GITHUB_ENV
echo "AR=gcc-ar-${{ matrix.build_settings.toolset_version }}" >> $GITHUB_ENV
else
echo "CXX=clang++-${{ matrix.build_settings.toolset_version }}" >> $GITHUB_ENV
echo "AR=llvm-ar-${{ matrix.build_settings.toolset_version }}" >> $GITHUB_ENV
fi
- name: Install dependencies
run: |
sudo gem install Mxx_ru
if [ "${{ matrix.build_settings.asio_source }}" == "boost-system-package" ]; then
sudo apt-get update && sudo apt-get install -y libboost-all-dev
fi
mxxruexternals
- name: Configure
if: ${{ matrix.build_settings.asio_source == 'standalone' }}
shell: bash
run: |
cd dev
cmake \
-B ${RESTINIO_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.build_settings.cppstd }} \
-DRESTINIO_TEST_SUFFIX=" [${RESTINIO_BUILD_TAG}]"
- name: Obtain Boost
if: ${{ matrix.build_settings.asio_source == 'boost' }}
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.83.0
boost_install_dir: ${{github.workspace}}/local_boost
toolset: ${{ matrix.build_settings.toolset }}
platform_version: 22.04
- name: Configure
if: ${{ matrix.build_settings.asio_source == 'boost' }}
shell: bash
run: |
cd dev
cmake \
-B ${RESTINIO_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.build_settings.cppstd }} \
-DRESTINIO_ASIO_SOURCE=boost \
-DBOOST_ROOT=${{ steps.install-boost.outputs.BOOST_ROOT }} \
-DRESTINIO_TEST_SUFFIX=" [${RESTINIO_BUILD_TAG}]"
- name: Configure
if: ${{ matrix.build_settings.asio_source == 'boost-system-package' }}
shell: bash
run: |
cd dev
cmake \
-B ${RESTINIO_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.build_settings.cppstd }} \
-DRESTINIO_ASIO_SOURCE=boost \
-DRESTINIO_TEST_SUFFIX=" [${RESTINIO_BUILD_TAG}]"
- name: Build
working-directory: ./dev
shell: bash
run: |
cmake \
--build $RESTINIO_BUILD_DIR \
--parallel $(nproc) \
--verbose
- name: Test
shell: bash
working-directory: ./dev
run: |
ctest \
-T test \
--test-dir $RESTINIO_BUILD_DIR \
--output-on-failure \
--no-compress-output
Build-Macos:
# The type of runner that the job will run on
name: macos-12 (${{ matrix.build_type }}, C++${{ matrix.cppstd }})
runs-on: macos-12
strategy:
fail-fast: false
matrix:
cppstd:
- 17
- 20
build_type:
- Release
- Debug
env:
RESTINIO_BUILD_DIR: _build_cpp${{ matrix.cppstd }}_${{ matrix.build_type }}
steps:
- uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies
run: |
gem install Mxx_ru
- name: Configure
shell: bash
run: |
mxxruexternals
cd dev
cmake \
-B ${RESTINIO_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRESTINIO_EXPLICIT_CPPSTD=${{ matrix.cppstd }} \
-DRESTINIO_TEST_SUFFIX=" [cpp${{ matrix.cppstd }}_${{ matrix.build_type }}]"
- name: Build
working-directory: ./dev
shell: bash
run: |
cmake \
--build $RESTINIO_BUILD_DIR \
--parallel $(sysctl -n hw.ncpu) \
--verbose
- name: Test
shell: bash
working-directory: ./dev
run: |
ctest \
-T test \
--test-dir $RESTINIO_BUILD_DIR \
--output-on-failure \
--no-compress-output