forked from laudrup/boost-wintls
-
Notifications
You must be signed in to change notification settings - Fork 0
203 lines (178 loc) · 6.49 KB
/
unittest.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
---
name: unittest
on: [push, pull_request]
# stop in-progress builds on push
concurrency:
group: unittest-${{ github.ref }}
cancel-in-progress: true
jobs:
unittest-boost-asio:
name: "${{matrix.generator}} ${{matrix.toolset}} Boost ${{matrix.boost_version}} ${{matrix.build_type}} C++${{matrix.standard}} ${{matrix.name_args}}"
runs-on: ${{matrix.os}}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
boost_version: ["1.81.0", "1.82.0", "1.83.0", "1.84.0"]
os: [windows-2019, windows-2022]
toolset: [v142, v143, ClangCL]
build_type: [Debug, Release]
standard: [14, 17, 20]
generator: ["Visual Studio 16 2019", "Visual Studio 17 2022"]
config_args: [""]
build_args: [""]
name_args: [""]
exclude:
- { os: windows-2019, toolset: v143 }
- { os: windows-2019, generator: "Visual Studio 17 2022" }
- { os: windows-2022, generator: "Visual Studio 16 2019" }
- { toolset: ClangCL, build_type: Release }
include:
- boost_version: "1.84.0"
os: windows-2022
toolset: v143
build_type: Debug
generator: "Visual Studio 17 2022"
config_args: ""
build_args: "-- -p:CharacterSet=Unicode"
name_args: "Unicode"
- boost_version: "1.84.0"
os: windows-2022
toolset: v143
build_type: Debug
generator: "Visual Studio 17 2022"
config_args: "-A Win32 -DENABLE_TESTING:BOOL=OFF"
name_args: "32 bit"
- boost_version: "1.84.0"
os: windows-2022
toolset: ""
build_type: ""
generator: "MinGW Makefiles"
config_args: ""
name_args: ""
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add boost toolset to environment
run: echo BOOST_TOOLSET=$([[ "${{matrix.generator}}" == "MinGW Makefiles" ]] && echo "mingw" || echo "msvc") >> $GITHUB_ENV
# The platform_version passed to boost-install determines the msvc toolset version for which static libs are installed.
- name: Add boost platform version to environment
run: |
declare -A toolset_to_platform_version=( [mingw]="2019" [v142]="2019" [v143]="2022" [ClangCL]="2019" )
key=$([[ "${{matrix.generator}}" == "MinGW Makefiles" ]] && echo "mingw" || echo "${{matrix.toolset}}")
echo BOOST_PLATFORM_VERSION="${toolset_to_platform_version[$key]}" >> $GITHUB_ENV
# install-boost does not provide pre-built clang binaries, hence tell cmake/FindBoost that we want to use vc142 binaries.
- name: Add boost compiler arg to environment
if: matrix.toolset == 'ClangCL'
run: echo BOOST_COMPILER_ARG="-DBoost_COMPILER=-vc142" >> $GITHUB_ENV
- name: Add boost install path to environment
run: echo BOOST_INSTALL_PATH="${GITHUB_WORKSPACE}/boost-${{matrix.boost_version}}${BOOST_TOOLSET}${BOOST_PLATFORM_VERSION}" >> $GITHUB_ENV
- name: Add build type configuration to environment
if: matrix.generator != 'MinGW Makefiles'
run: echo BUILD_CONFIG_ARG="--config ${{matrix.build_type}}" >> $GITHUB_ENV
- name: Add test type configuration to environment
if: matrix.generator != 'MinGW Makefiles'
run: echo TEST_CONFIG_ARG="-C ${{matrix.build_type}}" >> $GITHUB_ENV
- name: Cache Boost installation
id: cache-boost
uses: actions/cache@v4
with:
path: ${{env.BOOST_INSTALL_PATH}}
key: ${{matrix.boost_version}}${{env.BOOST_TOOLSET}}${{env.BOOST_PLATFORM_VERSION}}
- name: Install Boost
if: steps.cache-boost.outputs.cache-hit != 'true'
uses: MarkusJx/[email protected]
with:
boost_version: ${{matrix.boost_version}}
toolset: ${{env.BOOST_TOOLSET}}
boost_install_dir: ${{env.BOOST_INSTALL_PATH}}
platform_version: ${{env.BOOST_PLATFORM_VERSION}}
arch: null
- name: Increase size of pagefile
if: matrix.generator == 'MinGW Makefiles'
uses: al-cheb/[email protected]
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Create build directory
run: mkdir build
- name: Configure
working-directory: build
run: |
cmake -T "${{matrix.toolset}}" \
-G "${{matrix.generator}}" \
-DCMAKE_CXX_STANDARD=${{matrix.standard}} \
${{matrix.config_args}} \
${BOOST_COMPILER_ARG} \
"${GITHUB_WORKSPACE}"
env:
BOOST_ROOT: ${{env.BOOST_INSTALL_PATH}}/boost
OPENSSL_ROOT: ${{matrix.generator == 'MinGW Makefiles' && 'C:/Program Files/OpenSSL' || null}}
- name: Build
working-directory: build
run: |
cmake --build . \
-j \
${BUILD_CONFIG_ARG} \
${{matrix.build_args}}
- name: Run tests
working-directory: build
run: ctest ${TEST_CONFIG_ARG} -V
env:
CTEST_OUTPUT_ON_FAILURE: True
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
unittest-standalone-asio:
name: "${{matrix.asio_version}} ${{matrix.build_type}} C++${{matrix.standard}}"
runs-on: ${{matrix.os}}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
asio_version: ["asio-1-28-0", "asio-1-29-0"]
os: [windows-2022]
build_type: [Debug, Release]
standard: [14, 17, 20]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout Asio
uses: actions/checkout@v4
with:
repository: chriskohlhoff/asio
ref: ${{matrix.asio_version}}
fetch-depth: 0
path: asio
- name: Create build directory
run: mkdir build
- name: Configure
working-directory: build
run: |
cmake -DCMAKE_CXX_STANDARD=${{matrix.standard}} \
-DENABLE_WINTLS_STANDALONE_ASIO=ON \
-DAsio_ROOT="${GITHUB_WORKSPACE}/asio" \
"${GITHUB_WORKSPACE}"
- name: Build
working-directory: build
run: |
cmake --build . \
-j \
--config ${{matrix.build_type}}
- name: Run tests
working-directory: build
run: ctest -C ${{matrix.build_type}}
env:
CTEST_OUTPUT_ON_FAILURE: True
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3