-
-
Notifications
You must be signed in to change notification settings - Fork 49
179 lines (152 loc) · 5.07 KB
/
main.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
name: GitHub Actions CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build-linux-cmake:
name: CMake Build ${{ matrix.platform.name }} ${{ matrix.compiler.name }} ${{ matrix.flavor }} (${{ matrix.mode.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: x86, flags: "-m32" }
- { name: x64, flags: "-m64" }
compiler:
- { name: GNU, CC: gcc, CXX: g++ }
- { name: LLVM, CC: clang, CXX: clang++ }
flavor:
- Debug
- Release
mode:
- { name: default, args: "" }
- { name: NO_LIBC, args: -DZYAN_NO_LIBC=ON }
steps:
- name: Checkout
uses: actions/checkout@v4
- if: matrix.platform.name == 'x86'
name: Bootstrap
run: |
sudo dpkg --add-architecture i386
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get install -y g++-multilib g++
- name: Configure
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
run: |
mkdir build
cd build
cmake -DCMAKE_C_FLAGS=${{ matrix.platform.flags }} -DCMAKE_CXX_FLAGS=${{ matrix.platform.flags }} -DZYAN_DEV_MODE=ON ${{ matrix.mode.args }} ..
- name: Build
run: |
cmake --build build --config ${{ matrix.flavor }}
build-linux-meson:
name: Meson Build ${{ matrix.platform.name }} ${{ matrix.compiler.name }} ${{ matrix.flavor }} (${{ matrix.mode.name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: x86, flags: "-m32" }
- { name: x64, flags: "-m64" }
compiler:
- { name: GNU, CC: gcc, CXX: g++ }
- { name: LLVM, CC: clang, CXX: clang++ }
flavor:
- debug
- release
mode:
- { name: default, args: -Dtests=enabled }
- { name: NO_LIBC, args: -Dnolibc=true }
steps:
- name: Setup meson
run: |
pipx install meson
sudo apt-get install -y ninja-build
- name: Checkout
uses: actions/checkout@v4
- if: matrix.platform.name == 'x86'
name: Bootstrap
run: |
sudo dpkg --add-architecture i386
sudo rm /etc/apt/sources.list.d/* && sudo apt-get update
sudo apt-get install -y g++-multilib g++
- name: Configure
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
run: |
meson setup build-${{ matrix.flavor }} --buildtype=${{ matrix.flavor }} ${{ matrix.mode.args }} -Dc_extra_args="${{ matrix.platform.flags }}" -Dcpp_extra_args="${{ matrix.platform.flags }}"
- name: Build
run: |
meson compile -C build-${{ matrix.flavor }}
- name: Run tests
run: |
meson test -C build-${{ matrix.flavor }}
build-windows-cmake:
name: CMake Build ${{ matrix.platform.name }} ${{ matrix.compiler.name }} ${{ matrix.flavor }} (${{ matrix.mode.name }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: x86, flags: "Win32" }
- { name: x64, flags: "x64" }
compiler:
- { name: MSVC }
flavor:
- Debug
- Release
mode:
- { name: default, args: "" }
- { name: NO_LIBC, args: -DZYAN_NO_LIBC=ON }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: |
mkdir build
cd build
cmake -DCMAKE_GENERATOR_PLATFORM=${{ matrix.platform.flags }} -DZYAN_DEV_MODE=ON ${{ matrix.mode.args }} ..
- name: Build
run: |
cmake --build build --config ${{ matrix.flavor }}
build-windows-meson:
name: Meson Build ${{ matrix.platform.name }} ${{ matrix.compiler.name }} ${{ matrix.flavor }} (${{ matrix.mode.name }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform:
- { name: x86, flags: "amd64_x86" }
- { name: x64, flags: "amd64" }
compiler:
- { name: MSVC }
flavor:
- debug
- release
mode:
- { name: default, args: -Dtests=enabled }
- { name: NO_LIBC, args: -Dnolibc=true }
steps:
- name: Setup meson
run: |
pipx install meson
choco install ninja
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: |
$VCPATH = vswhere -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath -latest
& $VCPATH\VC\Auxiliary\Build\vcvarsall.bat ${{ matrix.platform.flags }}
meson setup build-${{ matrix.flavor }} --buildtype=${{ matrix.flavor }} ${{ matrix.mode.args }}
- name: Build
run: |
meson compile -C build-${{ matrix.flavor }}
- name: Run tests
run: |
meson test -C build-${{ matrix.flavor }}