-
Notifications
You must be signed in to change notification settings - Fork 10
223 lines (193 loc) · 7.01 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
name: CI
on: [push, pull_request]
env:
BOOST_VERSION: 1.82.0
BOOST_DIR_VER_NAME: 1_82_0
jobs:
windows:
name: "${{ matrix.toolset }} std=c++${{ matrix.cxxstd }} ${{ matrix.build-type }}"
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
include:
# internal compiler error
# - toolset: msvc-14.2 win64
# os: windows-2019
# architecture: x64
# generator: "Visual Studio 16 2019"
# cxxstd: 17
# build-type: 'Debug'
# cxxflags: ''
# ldflags: '/machine:x64'
- toolset: msvc-14.3 win32
os: windows-2022
architecture: Win32
generator: Visual Studio 17 2022
cxxstd: 20
build-type: 'Debug'
cxxflags: ''
ldflags: ''
- toolset: msvc-14.3 win64
os: windows-2022
architecture: x64
generator: Visual Studio 17 2022
cxxstd: 20
build-type: 'Debug'
cxxflags: ''
ldflags: ''
runs-on: ${{ matrix.os }}
env:
CXXFLAGS: ${{ matrix.cxxflags }} /D_WIN32_WINNT=0x0601 /DWIN32_LEAN_AND_MEAN=1 /DNOMINMAX=1 /D_FILE_OFFSET_BITS=64 /DBOOST_ALL_NO_LIB /EHsc /bigobj
LDFLAGS: ${{ matrix.ldflags }}
CMAKE_BUILD_PARALLEL_LEVEL: 4
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup OpenSSL
env:
OPENSSL_ROOT: "C:\\OpenSSL"
run: |
if "${{ matrix.architecture }}" == "x64" (
choco install --no-progress -y openssl --x64
)
if "${{ matrix.architecture }}" == "Win32" (
set openssl_install_dir="C:\\Program Files (x86)\\OpenSSL-Win32"
choco install --no-progress -y openssl --forcex86 --version 1.1.1.2100
)
if "${{ matrix.architecture }}" == "x64" (
if exist "C:\Program Files\OpenSSL\" (
set openssl_install_dir="C:\\Program Files\\OpenSSL"
) else (
set openssl_install_dir="C:\\Program Files\\OpenSSL-Win64"
)
)
mklink /D %OPENSSL_ROOT% %openssl_install_dir%
refreshenv
set
- name: Setup Cmake
run: |
choco install cmake
- name: Setup Boost
run: |
curl -o boost_${{ env.BOOST_DIR_VER_NAME }}.tar.gz https://archives.boost.io/release/${{ env.BOOST_VERSION }}/source/boost_${{ env.BOOST_DIR_VER_NAME }}.tar.gz
tar -xf boost_${{ env.BOOST_DIR_VER_NAME }}.tar.gz
mkdir ${{ github.workspace }}\\boost_${{ env.BOOST_DIR_VER_NAME }}
move boost_${{ env.BOOST_DIR_VER_NAME }}\\boost ${{ github.workspace }}\\boost_${{ env.BOOST_DIR_VER_NAME }}
del boost_${{ env.BOOST_DIR_VER_NAME }}.tar.gz
- name: Setup library
run: |
cmake -S . -B build -DBoost_INCLUDE_DIR="${{ github.workspace }}\\boost_${{ env.BOOST_DIR_VER_NAME }}"
cmake --install build
- name: Build tests
run: |
cmake -S test -B test\\build -A ${{ matrix.architecture }} ^
-DCMAKE_CXX_FLAGS="${{ env.CXXFLAGS }}" -DCMAKE_EXE_LINKER_FLAGS="${{ env.LDFLAGS }}" ^
-DCMAKE_CXX_STANDARD="${{ matrix.cxxstd }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-type }}" ^
-DBoost_INCLUDE_DIR="${{ github.workspace }}\\boost_${{ env.BOOST_DIR_VER_NAME }}"
cmake --build test\\build -j 4
- name: Run tests
run: |
.\\test\\build\\${{ matrix.build-type }}\\mqtt-test.exe
posix:
name: "${{ matrix.toolset }} std=c++${{ matrix.cxxstd }} ${{ matrix.build-type }}"
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- toolset: g++-10
compiler: g++-10
install: g++-10
os: ubuntu-latest
container: ubuntu:22.04
build-type: 'Release'
cxxstd: 17
cxxflags: ''
ldflags: ''
- toolset: g++-12
compiler: g++-12
install: g++-12
os: ubuntu-latest
container: ubuntu:22.04
build-type: 'Release'
cxxstd: 20
cxxflags: ''
ldflags: ''
- toolset: clang++-12
compiler: clang++-12
install: clang++-12
os: ubuntu-latest
container: ubuntu:22.04
build-type: 'Release'
cxxstd: 17
cxxflags: '-fdeclspec'
ldflags: ''
- toolset: clang++-13
compiler: clang++-13
install: clang++-13
os: ubuntu-latest
container: ubuntu:22.04
build-type: 'Release'
cxxstd: 17
cxxflags: '-fdeclspec'
ldflags: ''
- toolset: clang++-14-libc++-14
compiler: clang++-14
install: 'clang++-14 libc++-14-dev libc++abi-14-dev'
os: ubuntu-latest
container: ubuntu:22.04
build-type: 'Release'
cxxstd: 17
cxxflags: '-stdlib=libc++'
ldflags: '-lc++'
- toolset: clang++-15
compiler: clang++-15
install: clang++-15
os: ubuntu-latest
container: ubuntu:22.04
build-type: 'Release'
cxxstd: 20
cxxflags: ''
ldflags: ''
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
env:
CXXFLAGS: ${{ matrix.cxxflags }} -Wall -Wextra
LDFLAGS: ${{ matrix.ldflags }}
CMAKE_BUILD_PARALLEL_LEVEL: 4
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo wget tar cmake openssl libssl-dev pkg-config
- name: Install compiler
run: sudo apt-get install -y ${{ matrix.install }}
- name: Setup Boost
run: |
wget https://archives.boost.io/release/${{ env.BOOST_VERSION }}/source/boost_${{ env.BOOST_DIR_VER_NAME }}.tar.gz
tar xzf boost_${{ env.BOOST_DIR_VER_NAME }}.tar.gz
mkdir /usr/local/boost_${{ env.BOOST_DIR_VER_NAME }}
mv boost_${{ env.BOOST_DIR_VER_NAME }}/boost /usr/local/boost_${{ env.BOOST_DIR_VER_NAME }}
rm boost_${{ env.BOOST_DIR_VER_NAME }}.tar.gz
- name: Setup library
run: |
cmake -S . -B build -DCMAKE_CXX_COMPILER="${{ matrix.compiler }}" \
-DBoost_INCLUDE_DIR="/usr/local/boost_${{ env.BOOST_DIR_VER_NAME }}"
sudo cmake --install build
- name: Build tests
run: |
cmake -S test -B test/build \
-DCMAKE_CXX_COMPILER="${{ matrix.compiler }}" -DCMAKE_CXX_FLAGS="${{ env.CXXFLAGS }}" \
-DCMAKE_CXX_STANDARD="${{ matrix.cxxstd }}" -DCMAKE_EXE_LINKER_FLAGS="${{ env.LDFLAGS }}" -DCMAKE_BUILD_TYPE="${{ matrix.build-type }}" \
-DBoost_INCLUDE_DIR="/usr/local/boost_${{ env.BOOST_DIR_VER_NAME }}"
cmake --build test/build -j 4
- name: Run tests
run: ./test/build/mqtt-test