-
Notifications
You must be signed in to change notification settings - Fork 43
72 lines (68 loc) · 2.38 KB
/
build.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
name: Build
on: [push, pull_request]
env:
BUILD_TYPE: RelWithDebInfo
FLEXBISON_VER: 2.5.25
jobs:
build-linux:
runs-on: ubuntu-22.04
strategy:
matrix:
compiler: [gcc, clang]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure CMake
env:
CC: ${{matrix.compiler}}
CXX: ${{matrix.compiler == 'gcc' && 'g++' || 'clang++'}}
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
build-win32:
runs-on: windows-2022
strategy:
matrix:
arch: [x64, x86]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache winflexbison
id: cache-winflexbison
uses: actions/cache@v3
with:
path: win_flex_bison-${{env.FLEXBISON_VER}}.zip
key: winflexbison-${{env.FLEXBISON_VER}}
- name: Download winflexbison
if: steps.cache-winflexbison.outputs.cache-hit != 'true'
run: curl -OL https://github.com/lexxmark/winflexbison/releases/download/v${{env.FLEXBISON_VER}}/win_flex_bison-${{env.FLEXBISON_VER}}.zip
- name: Extract winflexbison
run: |
mkdir bison
cd bison
7z x ../win_flex_bison-${{env.FLEXBISON_VER}}.zip
- name: Configure CMake
run: cmake -B build -A ${{matrix.arch == 'x86' && 'Win32' || matrix.arch}} -DBISON_EXECUTABLE=${{github.workspace}}/bison/win_bison.exe -DFLEX_EXECUTABLE=${{github.workspace}}/bison/win_flex.exe -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Prepare Dist
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.arch}}
set THTK_ARCH=${{matrix.arch}}
call C:\shells\msys2bash.cmd -c "pacman -S --noconfirm --needed --noprogressbar groff dos2unix zip"
call C:\shells\msys2bash.cmd -c "./make-release.sh ci"
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: thtk-win32-${{matrix.arch}}
path: thtk-bin-ci/**/*
- name: Upload Artifact PDBs
uses: actions/upload-artifact@v3
with:
name: thtk-win32-${{matrix.arch}}-pdbs
path: thtk-bin-ci-pdbs/**/*