-
Notifications
You must be signed in to change notification settings - Fork 9
352 lines (280 loc) · 11.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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
name: GitHub CI
on:
- push
- pull_request
jobs:
windowsBuild:
name: Windows Build
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
CONFIGURATION:
- Debug
- Release
TARGET_CPU:
- x86
- amd64
LLVM_VERSION:
- llvm-3.4.2
- llvm-8.0.1
- llvm-18.1.8
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/') && matrix.CONFIGURATION == 'Release' }}
defaults:
run:
shell: cmd
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install
run: |
set CONFIGURATION=${{matrix.CONFIGURATION}}
set LLVM_VERSION=${{matrix.LLVM_VERSION}}
call ci\github-actions\set-env.bat msvc17 ${{matrix.TARGET_CPU}}
call ci\github-actions\install-windows.bat
git clone --branch re2s-no-abseil --depth 1 https://github.com/vovkos/re2s
git clone --depth 1 https://github.com/vovkos/axl
git clone --depth 1 https://github.com/vovkos/graco
- name: Setup NASM
uses: ilammy/setup-nasm@v1
if: ${{ matrix.TARGET_CPU == 'amd64' }}
- name: Build and test
run: |
set CONFIGURATION=${{matrix.CONFIGURATION}}
set LLVM_VERSION=${{matrix.LLVM_VERSION}}
set THIS_DIR=%CD%
set THIS_DIR_CMAKE=%THIS_DIR:\=/%
call ci\github-actions\set-env.bat msvc17 ${{matrix.TARGET_CPU}}
call axl\ci\github-actions\build-re2s.bat
call axl\ci\github-actions\build-lua.bat
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 graco\build
cd graco\build
cmake .. %CMAKE_CONFIGURE_FLAGS% || exit
cmake --build . %CMAKE_BUILD_FLAGS% || exit
cd %THIS_DIR%
echo set (GRACO_CMAKE_DIR %THIS_DIR_CMAKE%/graco/cmake %THIS_DIR_CMAKE%/graco/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-22.04
strategy:
fail-fast: false
matrix:
CONFIGURATION:
- Debug
- Release
TARGET_CPU:
- x86
- amd64
LLVM_VERSION:
- llvm-12
- llvm-14
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/') && matrix.CONFIGURATION == 'Release' }}
DEPLOY_BINARIES: ${{ github.ref == 'refs/heads/master' && matrix.CONFIGURATION == 'Release' }}
BUILD_DOC: ${{ github.ref == 'refs/heads/master' && matrix.CONFIGURATION == 'Release' && matrix.TARGET_CPU == 'amd64' && matrix.LLVM_VERSION == 'llvm-14' }}
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install
run: |
export TARGET_CPU=${{matrix.TARGET_CPU}}
export LLVM_VERSION=${{matrix.LLVM_VERSION}}
source ./ci/github-actions/install-linux.sh
git clone --branch re2s-no-abseil --depth 1 https://github.com/vovkos/re2s
git clone --depth 1 https://github.com/vovkos/axl
git clone --depth 1 https://github.com/vovkos/graco
- name: Build and test
run: |
THIS_DIR=$(pwd)
source axl/ci/github-actions/build-re2s.sh ${{matrix.TARGET_CPU}} ${{matrix.CONFIGURATION}}
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 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 build
pushd build
cmake .. -DTARGET_CPU=${{matrix.TARGET_CPU}} -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
ctest --output-on-failure
cmake . -DJANCY_TEST_JIT_KIND=--orc -DJANCY_TEST_DEBUG_INFO=
ctest --output-on-failure
popd
- name: Build documentation tools
if: ${{ env.BUILD_DOC == 'true' }}
run: |
THIS_DIR=$(pwd)
mkdir doxyrest/build
pushd doxyrest/build
cmake ..
make
popd
echo "set (DOXYREST_CMAKE_DIR $THIS_DIR/doxyrest/cmake $THIS_DIR/doxyrest/build/cmake)" >> paths.cmake
pushd build
cmake .
popd
- name: Build documentation
if: ${{ env.BUILD_DOC == 'true' }}
run: |
pushd build/doc
source index/build-html.sh
source build-guide/build-html.sh
source language/build-html.sh
source compiler/build-html.sh
source grammar/build-llk.sh
source grammar/build-html.sh
source stdlib/build-xml.sh
source stdlib/build-rst.sh
source stdlib/build-html.sh
source api/build-xml.sh
source api/build-rst.sh
source api/build-html.sh
touch 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
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@v4
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_dir: build/doc/html
force_orphan: true
- name: Build and deploy binary package
if: ${{ env.DEPLOY_BINARIES == 'true' }}
env:
JANCY_PACKAGE_ID_RSA: ${{secrets.JANCY_PACKAGE_ID_RSA}}
run: |
source ci/github-actions/deploy-package.sh linux-${{matrix.TARGET_CPU}}
macOsBuild:
name: macOS Build
runs-on: macos-13
strategy:
fail-fast: false
matrix:
CONFIGURATION:
- Debug
- Release
LLVM_VERSION:
- llvm@15
- llvm@17
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/') && matrix.CONFIGURATION == 'Release' }}
DEPLOY_BINARIES: ${{ github.ref == 'refs/heads/master' && matrix.CONFIGURATION == 'Release' }}
defaults:
run:
shell: bash
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install
run: |
export LLVM_VERSION=${{matrix.LLVM_VERSION}}
source ./ci/github-actions/install-osx.sh
git clone --branch re2s-no-abseil --depth 1 https://github.com/vovkos/re2s
git clone --depth 1 https://github.com/vovkos/axl
git clone --depth 1 https://github.com/vovkos/graco
- name: Build and test
run: |
THIS_DIR=$(pwd)
source axl/ci/github-actions/build-re2s.sh $(uname -m) ${{matrix.CONFIGURATION}}
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 graco/build
pushd graco/build
cmake .. -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}}
make
popd
echo "set (GRACO_CMAKE_DIR $THIS_DIR/graco/cmake $THIS_DIR/graco/build/cmake)" >> paths.cmake
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=${{matrix.CONFIGURATION}} -DJANCY_TEST_JIT_KIND=${{matrix.JIT_KIND}} -DJANCY_TEST_DEBUG_INFO=$DEBUG_INFO
make
ctest --output-on-failure
cmake . -DJANCY_TEST_JIT_KIND=--orc -DJANCY_TEST_DEBUG_INFO=
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
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: Build and deploy binary package
if: ${{ env.DEPLOY_BINARIES == 'true' }}
env:
JANCY_PACKAGE_ID_RSA: ${{secrets.JANCY_PACKAGE_ID_RSA}}
run: |
source ci/github-actions/deploy-package.sh osx-amd64