forked from jacobly0/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
500 lines (458 loc) · 23.2 KB
/
cmake.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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
name: CMake
on:
push:
branches: [z80]
jobs:
build-llvm:
needs: []
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
build-type: [Release]
runs-on: ${{matrix.runs-on}}
steps:
- name: Uninstall Unused Packages
if: runner.os == 'Linux'
run: sudo apt-get remove azure-cli libgl1-mesa-dri ^google-chrome.*$ ^dotnet-sdk-[0-9.]+$ firefox
- name: Bootstrap Build Environment
if: runner.os == 'Windows'
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
- name: Prepare Build Environment
if: runner.os != 'Windows'
run: |
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CC=clang
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CFLAGS=-std=c17
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CXX=clang++
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CXXFLAGS=-std=c++17
- name: Prepare Build Environment
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
$path = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
cmake -E echo >> $${{env.ENV}}GITHUB_PATH "$(join-path $path 'VC\Tools\Llvm\bin')"
cmd /s /c >> $${{env.ENV}}GITHUB_ENV """$(join-path $path 'Common7\Tools\vsdevcmd.bat')"" > nul && set"
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CC=clang-cl
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CXX=clang-cl
cmake -E echo >> $${{env.ENV}}GITHUB_ENV EXE=.exe
cmake -E echo >> $${{env.ENV}}GITHUB_ENV PY=.py
- name: Prepare Build Configuration
if: matrix.build-type == 'Release'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV CMAKE_CONFIG=-DLLVM_TARGETS_TO_BUILD:STRING= -DLLVM_ENABLE_LTO:STRING=OFF -DLLVM_STATIC_LINK_CXX_STDLIB:BOOL=ON
- name: Prepare Build Environment
if: matrix.build-type == 'Debug'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV DYLIB=ON
- name: Prepare Build Environment
if: matrix.build-type != 'Debug'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV DYLIB=OFF
- name: Install Build Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get install -y ninja-build
cmake -E echo >> $${{env.ENV}}GITHUB_ENV
- name: Install Build Dependencies
if: runner.os == 'macOS'
run: |
brew install ninja
cmake -E echo >> $${{env.ENV}}GITHUB_PATH /usr/local/opt/llvm/bin
- name: Install Build Dependencies
if: runner.os == 'Windows'
run: pip install ninja
- name: Checkout Project
uses: actions/checkout@v4
with:
path: src
- name: Sparse Checkout
working-directory: src
run: |
git version
git sparse-checkout init --cone
git sparse-checkout set cmake third-party llvm clang
- name: Configure LLVM
run: cmake -Ssrc/llvm -Bbuild -GNinja -DCMAKE_BUILD_TYPE:STRING=${{matrix.build-type}} ${{env.CMAKE_CONFIG}} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH="${{github.workspace}}/llvm" -DCMAKE_C_COMPILER:FILEPATH="${{env.CC}}" -DCMAKE_C_FLAGS:STRING="${{env.CFLAGS}}" -DCMAKE_CXX_COMPILER:FILEPATH="${{env.CXX}}" -DCMAKE_CXX_FLAGS:STRING="${{env.CXXFLAGS}}" -DLLVM_PARALLEL_LINK_JOBS:STRING=1 -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD:STRING="Z80" -DLLVM_TARGET_ARCH="ez80" -DLLVM_LINK_LLVM_DYLIB:BOOL=${{env.DYLIB}} -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF -DLLVM_INCLUDE_TESTS:BOOL=OFF -DLLVM_TOOL_DSYMUTIL_BUILD:BOOL=OFF -DLLVM_TOOL_GOLD_BUILD:BOOL=OFF -DLLVM_TOOL_LLVM_AS_FUZZER_BUILD:BOOL=OFF -DLLVM_TOOL_LLVM_CFI_VERI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ILD:BOOL=OFF -DLLVM_TOOL_SANSTATS_BUILD:BOOL=OFF -DLLVM_TOOL_VFABI_DEMANGLE_FUZZER_BUILD:BOOL=OFF
- name: Build LLVM
run: cmake --build build --config ${{matrix.build-type}}
- name: Install LLVM
run: |
cmake --build build --config ${{matrix.build-type}} --target install
cmake -E copy build/include/llvm/Config/config.h llvm/include/llvm/Config
- name: Upload LLVM
uses: actions/upload-artifact@v3
with:
name: LLVM${{matrix.runs-on}}${{matrix.build-type}}
path: llvm
- name: Install ez80-link
run: cmake -E copy llvm/bin/llvm-link${{env.EXE}} ez80-link${{env.EXE}}
- name: Strip ez80-link
if: runner.os != 'Windows'
run: strip ez80-link${{env.EXE}}
- name: Upload ez80-link
uses: actions/upload-artifact@v3
with:
name: ez80-link${{env.EXE}}-${{matrix.runs-on}}${{matrix.build-type}}
path: ez80-link${{env.EXE}}
- name: Install ez80-lto
run: cmake -E copy llvm/bin/llvm-lto${{env.EXE}} ez80-lto${{env.EXE}}
- name: Strip ez80-lto
if: runner.os != 'Windows'
run: strip ez80-lto${{env.EXE}}
- name: Upload ez80-lto
uses: actions/upload-artifact@v3
with:
name: ez80-lto${{env.EXE}}-${{matrix.runs-on}}${{matrix.build-type}}
path: ez80-lto${{env.EXE}}
- name: Install ez80-lto2
run: cmake -E copy llvm/bin/llvm-lto2${{env.EXE}} ez80-lto2${{env.EXE}}
- name: Strip ez80-lto2
if: runner.os != 'Windows'
run: strip ez80-lto2${{env.EXE}}
- name: Upload ez80-lto2
uses: actions/upload-artifact@v3
with:
name: ez80-lto2${{env.EXE}}-${{matrix.runs-on}}${{matrix.build-type}}
path: ez80-lto2${{env.EXE}}
- name: Configure Test
run: cmake build -DLLVM_LINK_LLVM_DYLIB:BOOL=${{env.DYLIB}} -DLLVM_ENABLE_PROJECTS:STRING=clang -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF -DLLVM_INCLUDE_TESTS:BOOL=ON -DLLVM_TOOL_DSYMUTIL_BUILD:BOOL=ON -DL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TOOL_LLVM_YAML_NUMERIC_PARSER_FUZZER_BUILD:BOOL=ON -DLLVM_TOOL_SANCOV_BUILD:BOOL=ON -DLLVM_TOOL_SANSTATS_BUILD:BOOL=ON -DLLVM_TOOL_VFABI_DEMANGLE_FUZZER_BUILD:BOOL=ON
- name: Build Test
run: cmake --build build --config ${{matrix.build-type}} --target Z80Tests
- name: Install Test
run: |
cmake -E make_directory test/bin test/test/Unit test/tools/clang/bin test/tools/clang/test/Unit test/unittests/Target/Z80
cmake -E copy build/bin/not${{env.EXE}} build/bin/FileCheck${{env.EXE}} build/bin/llvm-PerfectShuffle${{env.EXE}} build/bin/lli-child-target${{env.EXE}} build/bin/llvm-lit${{env.PY}} build/bin/llvm-locstats build/bin/count${{env.EXE}} build/bin/yaml-bench${{env.EXE}} test/bin
cmake -E copy build/test/lit.site.cfg.py test/test
cmake -E copy build/test/Unit/lit.site.cfg.py test/test/Unit
cmake -E copy build/tools/clang/bin/gen_ast_dump_json_test.py test/tools/clang/bin
cmake -E copy build/tools/clang/test/lit.site.cfg.py test/tools/clang/test
cmake -E copy build/tools/clang/test/Unit/lit.site.cfg.py test/tools/clang/test/Unit
cmake -E copy build/unittests/Target/Z80/Z80Tests${{env.EXE}} test/unittests/Target/Z80
- name: Upload Test
uses: actions/upload-artifact@v3
with:
name: Test${{matrix.runs-on}}${{matrix.build-type}}
path: test
- name: Disk Usage
if: always() && runner.os != 'Windows'
run: df -h
- name: Disk Usage
if: always() && runner.os == 'Windows'
run: wmic logicaldisk get size,freespace,caption
build-clang:
needs: [build-llvm]
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
build-type: [Release]
runs-on: ${{matrix.runs-on}}
steps:
- name: Uninstall Unused Packages
if: runner.os == 'Linux'
run: sudo apt-get remove azure-cli libgl1-mesa-dri ^google-chrome.*$ ^dotnet-sdk-[0-9.]+$ firefox
- name: Bootstrap Build Environment
if: runner.os == 'Windows'
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
- name: Prepare Build Environment
if: runner.os != 'Windows'
run: |
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CC=clang
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CFLAGS=-std=c17
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CXX=clang++
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CXXFLAGS=-std=c++17
- name: Prepare Build Environment
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
$path = vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
cmake -E echo >> $${{env.ENV}}GITHUB_PATH "$(join-path $path 'VC\Tools\Llvm\bin')"
cmd /s /c >> $${{env.ENV}}GITHUB_ENV """$(join-path $path 'Common7\Tools\vsdevcmd.bat')"" > nul && set"
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CC=clang-cl
cmake -E echo >> $${{env.ENV}}GITHUB_ENV CXX=clang-cl
cmake -E echo >> $${{env.ENV}}GITHUB_ENV EXE=.exe
cmake -E echo >> $${{env.ENV}}GITHUB_ENV PY=.py
- name: Prepare Build Configuration
if: matrix.build-type == 'Release'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV CMAKE_CONFIG=-DLLVM_TARGETS_TO_BUILD:STRING= -DLLVM_ENABLE_LTO:STRING=OFF -DLLVM_STATIC_LINK_CXX_STDLIB:BOOL=ON
- name: Prepare Build Environment
if: matrix.build-type == 'Debug'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV DYLIB=ON
- name: Prepare Build Environment
if: matrix.build-type != 'Debug'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV DYLIB=OFF
- name: Install Build Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get install -y ninja-build
cmake -E echo >> $${{env.ENV}}GITHUB_ENV
- name: Install Build Dependencies
if: runner.os == 'macOS'
run: |
brew install ninja
cmake -E echo >> $${{env.ENV}}GITHUB_PATH /usr/local/opt/llvm/bin
- name: Install Build Dependencies
if: runner.os == 'Windows'
run: pip install ninja
- name: Checkout Project
uses: actions/checkout@v4
with:
path: src
- name: Sparse Checkout
working-directory: src
run: |
git version
git sparse-checkout init --cone
git sparse-checkout set cmake third-party clang
- name: Download Test
uses: actions/download-artifact@v3
with:
name: Test${{matrix.runs-on}}${{matrix.build-type}}
path: llvm
- name: Download LLVM
uses: actions/download-artifact@v3
with:
name: LLVM${{matrix.runs-on}}${{matrix.build-type}}
path: llvm
- name: Set Executable
if: runner.os != 'Windows'
run: chmod +x llvm/bin/*
- name: Configure Clang
run: cmake -Ssrc/clang -Bbuild -GNinja -DCMAKE_BUILD_TYPE:STRING=${{matrix.build-type}} ${{env.CMAKE_CONFIG}} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH="${{github.workspace}}/clang" -DCMAKE_C_COMPILER:FILEPATH="${{env.CC}}" -DCMAKE_C_FLAGS:STRING="${{env.CFLAGS}}" -DCMAKE_CXX_COMPILER:FILEPATH="${{env.CXX}}" -DCMAKE_CXX_FLAGS:STRING="${{env.CXXFLAGS}}" -DLLVM_DIR:PATH="${{github.workspace}}/llvm/lib/cmake/llvm" -DCLANG_LINK_CLANG_DYLIB:BOOL=${{env.DYLIB}} -DCLANG_TOOL_AMDGPU_ARCH_BUILD:BOOL=OFF -DCLANG_TOOL_APINOTES_TEST_BUILD:BOOL=OFF -DCLANG_TOOL_ARCMT_TEST_BUILD:BOOL=ON -DCLANG_TOOL_CLANG_CHECK_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_DIFF_BUILD:BOOL=ON -DCLANG_TOOL_CLANG_EXTDEF_MAPPING_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_FORMAT_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_FORMAT_VS_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_FUZZER_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_IMPORT_TEST_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_LINKER_WRAPPER_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_NVLINK_WRAPPER_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_OFFLOAD_BUNDLER_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_OFFLOAD_PACKAGER_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_OFFLOAD_WRAPPER_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_REFACTOR_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_RENAME_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_REPL_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_SCAN_DEPS_BUILD:BOOL=OFF -DCLANG_TOOL_CLANG_SHLIB_BUILD:BOOL=OFF -DCLANG_TOOL_C_ARCMT_TEST_BUILD:BOOL=ON -DCLANG_TOOL_C_INDEX_TEST_BUILD:BOOL=OFF -DCLANG_TOOL_DIAGTOOL_BUILD:BOOL=OFF -DCLANG_TOOL_DRIVER_BUILD:BOOL=ON -DCLANG_TOOL_LIBCLANG_BUILD:BOOL=ON -DCLANG_TOOL_SCAN_BUILD_BUILD:BOOL=OFF -DCLANG_TOOL_SCAN_BUILD_PY_BUILD:BOOL=OFF -DCLANG_TOOL_SCAN_VIEW_BUILD:BOOL=OFF -DLLVM_EXTERNAL_LIT:PATH="${{github.workspace}}/llvm/bin/llvm-lit${{env.PY}}"
- name: Build Clang
run: cmake --build build --config ${{matrix.build-type}}
- name: Install Clang
run: cmake --build build --config ${{matrix.build-type}} --target install
- name: Upload Clang
uses: actions/upload-artifact@v3
with:
name: Clang${{matrix.runs-on}}${{matrix.build-type}}
path: clang
- name: Install ez80-clang
run: cmake -E copy clang/bin/clang${{env.EXE}} ez80-clang${{env.EXE}}
- name: Strip ez80-clang
if: runner.os != 'Windows'
run: strip ez80-clang${{env.EXE}}
- name: Test ez80-clang
run: cmake -E echo "void test(void){}" | ./ez80-clang${{env.EXE}} -S -xc - -o -
- name: Upload ez80-clang
uses: actions/upload-artifact@v3
with:
name: ez80-clang${{env.EXE}}-${{matrix.runs-on}}${{matrix.build-type}}
path: ez80-clang${{env.EXE}}
- name: Download Test
uses: actions/download-artifact@v3
with:
name: Test${{matrix.runs-on}}${{matrix.build-type}}
path: test
- name: Install Test
run: cmake -E copy build/bin/arcmt-test${{env.EXE}} build/bin/c-arcmt-test${{env.EXE}} build/bin/clang-diff${{env.EXE}} build/bin/clang-tblgen${{env.EXE}} test/bin
- name: Upload Test
uses: actions/upload-artifact@v3
with:
name: Test${{matrix.runs-on}}${{matrix.build-type}}
path: test
- name: Disk Usage
if: always() && runner.os != 'Windows'
run: df -h
- name: Disk Usage
if: always() && runner.os == 'Windows'
run: wmic logicaldisk get size,freespace,caption
test-llvm-z80:
needs: [build-llvm]
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
build-type: [Release]
runs-on: ${{matrix.runs-on}}
steps:
- name: Uninstall Unused Packages
if: runner.os == 'Linux'
run: sudo apt-get remove azure-cli libgl1-mesa-dri ^google-chrome.*$ ^dotnet-sdk-[0-9.]+$ firefox
- name: Bootstrap Build Environment
if: runner.os == 'Windows'
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
- name: Prepare Build Environment
if: runner.os == 'Windows'
run: |
cmake -E echo >> $${{env.ENV}}GITHUB_ENV EXE=.exe
cmake -E echo >> $${{env.ENV}}GITHUB_ENV PY=.py
- name: Checkout Project
uses: actions/checkout@v4
with:
path: src
- name: Sparse Checkout
working-directory: src
run: |
git version
git sparse-checkout init --cone
git sparse-checkout set cmake llvm/test llvm/utils/lit/lit llvm/unittest third-party
- name: Download Test
uses: actions/download-artifact@v3
with:
name: Test${{matrix.runs-on}}${{matrix.build-type}}
path: build
- name: Download LLVM
uses: actions/download-artifact@v3
with:
name: LLVM${{matrix.runs-on}}${{matrix.build-type}}
path: build
- name: Set Executable
if: runner.os != 'Windows'
run: chmod +x build/bin/* build/unittests/Target/Z80/Z80Tests${{env.EXE}}
- name: Unittest LLVM Z80
run: build/unittests/Target/Z80/Z80Tests${{env.EXE}}
- name: Test LLVM Z80
run: build/bin/llvm-lit${{env.PY}} -v src/llvm/test/CodeGen/Z80
test-llvm:
needs: [build-llvm]
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
build-type: [Debug]
continue-on-error: true
if: false
runs-on: ${{matrix.runs-on}}
steps:
- name: Uninstall Unused Packages
if: runner.os == 'Linux'
run: sudo apt-get remove azure-cli libgl1-mesa-dri ^google-chrome.*$ ^dotnet-sdk-[0-9.]+$ firefox
- name: Bootstrap Build Environment
if: runner.os == 'Windows'
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
- name: Prepare Build Environment
if: runner.os == 'Windows'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV PY=.py
- name: Checkout Project
uses: actions/checkout@v4
with:
path: src
- name: Sparse Checkout
working-directory: src
run: |
git version
git sparse-checkout init --cone
git sparse-checkout set cmake third-party llvm/test llvm/utils/lit/lit
- name: Download Test
uses: actions/download-artifact@v3
with:
name: Test${{matrix.runs-on}}${{matrix.build-type}}
path: build
- name: Download LLVM
uses: actions/download-artifact@v3
with:
name: LLVM${{matrix.runs-on}}${{matrix.build-type}}
path: build
- name: Set Executable
if: runner.os != 'Windows'
run: chmod +x build/bin/*
- name: Test LLVM
run: build/bin/llvm-lit${{env.PY}} -v src/llvm/test
test-clang:
needs: [build-llvm, build-clang]
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
build-type: [Debug]
continue-on-error: true
if: false
runs-on: ${{matrix.runs-on}}
steps:
- name: Uninstall Unused Packages
if: runner.os == 'Linux'
run: sudo apt-get remove azure-cli libgl1-mesa-dri ^google-chrome.*$ ^dotnet-sdk-[0-9.]+$ firefox
- name: Bootstrap Build Environment
if: runner.os == 'Windows'
run: "cmake -E echo >> $env:GITHUB_ENV ENV=env:"
- name: Prepare Build Environment
if: runner.os == 'Windows'
run: cmake -E echo >> $${{env.ENV}}GITHUB_ENV PY=.py
- name: Checkout Project
uses: actions/checkout@v4
with:
path: src
- name: Sparse Checkout
working-directory: src
run: |
git version
git sparse-checkout init --cone
git sparse-checkout set cmake third-party clang/test llvm/utils/lit/lit
- name: Download Test
uses: actions/download-artifact@v3
with:
name: Test${{matrix.runs-on}}${{matrix.build-type}}
path: build
- name: Download LLVM
uses: actions/download-artifact@v3
with:
name: LLVM${{matrix.runs-on}}${{matrix.build-type}}
path: build
- name: Download Clang
uses: actions/download-artifact@v3
with:
name: Clang${{matrix.runs-on}}${{matrix.build-type}}
path: build
- name: Set Executable
if: runner.os != 'Windows'
run: chmod +x build/bin/*
- name: Test Clang
run: build/bin/llvm-lit${{env.PY}} -v src/clang/test
nightly:
runs-on: ubuntu-latest
needs: [build-clang, test-clang, test-llvm, test-llvm-z80]
if: github.ref == 'refs/heads/z80'
steps:
- name: Download Ubuntu 20.04 ez80-clang
uses: actions/download-artifact@v3
with:
name: ez80-clang-ubuntu-20.04Release
path: ${{github.workspace}}
- name: Download Ubuntu 20.04 ez80-link
uses: actions/download-artifact@v3
with:
name: ez80-link-ubuntu-20.04Release
path: ${{github.workspace}}
- name: chmod and zip Ubuntu Artifacts
run: |
chmod +x ez80-clang ez80-link
zip ez80-clang-link_ubuntu_nightly.zip ez80-clang ez80-link
rm ez80-clang ez80-link
- name: Download macOS 11 ez80-clang
uses: actions/download-artifact@v3
with:
name: ez80-clang-macos-11Release
path: ${{github.workspace}}
- name: Download macOS 11 ez80-link
uses: actions/download-artifact@v3
with:
name: ez80-link-macos-11Release
path: ${{github.workspace}}
- name: chmod and zip macOS Artifacts
run: |
chmod +x ez80-clang ez80-link
zip ez80-clang-link_macOS_nightly.zip ez80-clang ez80-link
rm ez80-clang ez80-link
- name: Download Windows 20.04 ez80-clang
uses: actions/download-artifact@v3
with:
name: ez80-clang.exe-windows-latestRelease
path: ${{github.workspace}}
- name: Download Windows ez80-link
uses: actions/download-artifact@v3
with:
name: ez80-link.exe-windows-latestRelease
path: ${{github.workspace}}
- name: zip Windows Artifacts
run: |
zip ez80-clang-link_windows_nightly.zip ez80-clang.exe ez80-link.exe
rm ez80-clang.exe ez80-link.exe
- name: Update nightly release
uses: pyTooling/Actions/releaser@main
with:
tag: nightly
rm: true
token: ${{secrets.GITHUB_TOKEN}}
files: |
ez80-clang-link_ubuntu_nightly.zip
ez80-clang-link_macOS_nightly.zip
ez80-clang-link_windows_nightly.zip