-
Notifications
You must be signed in to change notification settings - Fork 23
326 lines (258 loc) · 10.7 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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
name: GitHub CI
on:
- push
- pull_request
jobs:
windowsBuild:
name: Windows Build
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
CONFIGURATION:
- Debug
- Release
TARGET_CPU:
- x86
- amd64
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/') && matrix.CONFIGURATION == 'Release' }}
defaults:
run:
shell: cmd
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install
run: |
set CONFIGURATION=${{matrix.CONFIGURATION}}
call ci\github-actions\set-env.bat msvc16 ${{matrix.TARGET_CPU}}
call ci\github-actions\install-windows.bat
git clone --depth 1 https://github.com/vovkos/axl
- name: Build and test
run: |
set CONFIGURATION=${{matrix.CONFIGURATION}}
set DOWNLOAD_DIR=%CD:~0,2%\downloads
set DOWNLOAD_DIR_CMAKE=%DOWNLOAD_DIR:\=/%
set THIS_DIR=%CD%
set THIS_DIR_CMAKE=%THIS_DIR:\=/%
call ci\github-actions\set-env.bat msvc16 ${{matrix.TARGET_CPU}}
mkdir %DOWNLOAD_DIR%\expat\build
cd %DOWNLOAD_DIR%\expat\build
cmake .. %CMAKE_CONFIGURE_FLAGS% %EXPAT_CMAKE_FLAGS% || exit
cmake --build . %CMAKE_BUILD_FLAGS% || exit
cd %THIS_DIR%
echo set (EXPAT_INC_DIR %DOWNLOAD_DIR_CMAKE%/expat/lib) >> paths.cmake
echo set (EXPAT_LIB_DIR %DOWNLOAD_DIR_CMAKE%/expat/build/%CONFIGURATION%) >> paths.cmake
mkdir axl\build
cd axl\build
cmake .. %CMAKE_CONFIGURE_FLAGS% || exit
cmake --build . %CMAKE_BUILD_FLAGS% || exit
cd %THIS_DIR%
echo set (AXL_CMAKE_DIR %THIS_DIR_CMAKE%/axl/cmake %THIS_DIR_CMAKE%/axl/build/cmake) >> paths.cmake
mkdir build
cd build
cmake .. %CMAKE_CONFIGURE_FLAGS% || exit
cmake --build . %CMAKE_BUILD_FLAGS% || exit
ctest --output-on-failure -C %CONFIGURATION% || exit
- name: Package
id: PACKAGE
if: ${{ env.RELEASE == 'true' }}
run: |
set THIS_DIR=%CD%
set THIS_DIR_CMAKE=%THIS_DIR:\=/%
cd build
cpack -G 7Z -C Release
for /f "usebackq tokens=*" %%i in (`cmake -P print-package-file-name.cmake 2^>^&1`) do (set CPACK_PACKAGE_FILE_NAME=%%i)
set DEPLOY_FILE=build/%CPACK_PACKAGE_FILE_NAME%.7z
echo ::set-output name=DEPLOY_FILE::%DEPLOY_FILE%
- name: Deploy to GitHub Releases
uses: softprops/action-gh-release@v1
if: ${{ env.RELEASE == 'true' }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
files: ${{steps.PACKAGE.outputs.DEPLOY_FILE}}
linuxBuild:
name: Linux Build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
CONFIGURATION:
- Debug
- Release
TARGET_CPU:
- x86
- amd64
COMPILER:
- gcc
- clang
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/') && matrix.CONFIGURATION == 'Release' && matrix.COMPILER == 'gcc' }}
BUILD_DOC: ${{ github.ref == 'refs/heads/master' && matrix.CONFIGURATION == 'Release' && matrix.TARGET_CPU == 'amd64' && matrix.COMPILER == 'gcc' }}
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install
run: |
export TARGET_CPU=${{matrix.TARGET_CPU}}
source ./ci/github-actions/install-linux.sh
git clone --depth 1 https://github.com/vovkos/axl
- name: Install documentation tools
if: ${{ env.BUILD_DOC == 'true' }}
run: |
git clone --depth 1 https://github.com/vovkos/graco
git clone --depth 1 https://github.com/vovkos/luadoxyxml
- name: Build and test
run: |
THIS_DIR=$(pwd)
export CC=$(which ${{matrix.COMPILER}})
export CXX=$(which ${{matrix.COMPILER}}++)
mkdir axl/build
pushd axl/build
cmake .. -DTARGET_CPU=${{matrix.TARGET_CPU}} -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
popd
echo "set (AXL_CMAKE_DIR $THIS_DIR/axl/cmake $THIS_DIR/axl/build/cmake)" >> paths.cmake
mkdir build
pushd build
cmake .. -DTARGET_CPU=${{matrix.TARGET_CPU}} -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
ctest --output-on-failure
popd
- name: Build documentation tools
if: ${{ env.BUILD_DOC == 'true' }}
run: |
THIS_DIR=$(pwd)
mkdir graco/build
pushd graco/build
cmake .. -DTARGET_CPU=${{matrix.TARGET_CPU}} -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
popd
echo "set(GRACO_CMAKE_DIR $THIS_DIR/graco/cmake $THIS_DIR/graco/build/cmake)" >> paths.cmake
mkdir luadoxyxml/build
pushd luadoxyxml/build
cmake .. -DTARGET_CPU=${{matrix.TARGET_CPU}} -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
popd
echo "set(LUADOXYXML_EXE $THIS_DIR/luadoxyxml/build/bin/${{matrix.CONFIGURATION}}/luadoxyxml)" >> paths.cmake
pushd build
cmake .
popd
- name: Build documentation
if: ${{ env.BUILD_DOC == 'true' }}
run: |
pushd build
source doc/index/build-html.sh
source doc/build-guide/build-html.sh
source doc/manual/build-xml.sh
source doc/manual/build-rst.sh
source doc/manual/build-html.sh
source samples/libusb/build-rst.sh
source samples/libusb/build-html.sh -D html_theme=sphinxdoc
mv doc/html/samples/{libusb,libusb-sphinxdoc}
source samples/libusb/build-html.sh
source samples/libssh/build-rst.sh
source samples/libssh/build-html.sh -D html_theme=sphinxdoc
mv doc/html/samples/{libssh,libssh-sphinxdoc}
source samples/libssh/build-html.sh
source samples/alsa/build-rst.sh
source samples/alsa/build-html.sh -D html_theme=sphinxdoc
mv doc/html/samples/{alsa,alsa-sphinxdoc}
source samples/alsa/build-html.sh
source samples/apr/build-rst.sh
source samples/apr/build-html.sh -D html_theme=sphinxdoc
mv doc/html/samples/{apr,apr-sphinxdoc}
source samples/apr/build-html.sh
touch doc/html/.nojekyll
popd
- name: Package
id: PACKAGE
if: ${{ env.RELEASE == 'true' }}
run: |
set THIS_DIR=%CD%
set THIS_DIR_CMAKE=%THIS_DIR:\=/%
cd build
cpack -G TXZ
CPACK_PACKAGE_FILE_NAME=$(cmake -P print-package-file-name.cmake 2>&1)
DEPLOY_FILE=build/$CPACK_PACKAGE_FILE_NAME.tar.xz
cmake -P print-package-file-name.cmake
echo CPACK_PACKAGE_FILE_NAME: $CPACK_PACKAGE_FILE_NAME
echo DEPLOY_FILE: $DEPLOY_FILE
echo ::set-output name=DEPLOY_FILE::$DEPLOY_FILE
- name: Deploy to GitHub Releases
if: ${{ env.RELEASE == 'true' }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
files: ${{steps.PACKAGE.outputs.DEPLOY_FILE}}
- name: Deploy to GitHub Pages
if: ${{ env.BUILD_DOC == 'true' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_dir: build/doc/html
force_orphan: true
macOsBuild:
name: macOS Build
runs-on: macos-11
strategy:
fail-fast: false
matrix:
CONFIGURATION:
- Debug
- Release
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/') && matrix.CONFIGURATION == 'Release' }}
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install
run: |
pwd
source ./ci/github-actions/install-osx.sh
git clone --depth 1 https://github.com/vovkos/axl
- name: Build and test
run: |
THIS_DIR=$(pwd)
mkdir axl/build
pushd axl/build
cmake .. -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
popd
echo "set (AXL_CMAKE_DIR $THIS_DIR/axl/cmake $THIS_DIR/axl/build/cmake)" >> paths.cmake
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
ctest --output-on-failure
popd
- name: Package
id: PACKAGE
if: ${{ env.RELEASE == 'true' }}
run: |
set THIS_DIR=%CD%
set THIS_DIR_CMAKE=%THIS_DIR:\=/%
cd build
cpack -G TXZ
CPACK_PACKAGE_FILE_NAME=$(cmake -P print-package-file-name.cmake 2>&1)
DEPLOY_FILE=build/$CPACK_PACKAGE_FILE_NAME.tar.xz
cmake -P print-package-file-name.cmake
echo CPACK_PACKAGE_FILE_NAME: $CPACK_PACKAGE_FILE_NAME
echo DEPLOY_FILE: $DEPLOY_FILE
echo ::set-output name=DEPLOY_FILE::$DEPLOY_FILE
- name: Deploy to GitHub Releases
if: ${{ env.RELEASE == 'true' }}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
files: ${{steps.PACKAGE.outputs.DEPLOY_FILE}}