-
Notifications
You must be signed in to change notification settings - Fork 2
282 lines (267 loc) · 9.66 KB
/
Copy pathci.yml
File metadata and controls
282 lines (267 loc) · 9.66 KB
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
on:
push
concurrency:
group: global-ci # any run will cancel the others
cancel-in-progress: true
permissions:
contents: write
pages: write
id-token: write
# TODO: codegen before each step
# TODO: publish dockers automatically in "release" (so they have up-to-date headers after codegen)
jobs:
# TODO: seperate these into different steps and remove matrix?
host_linux:
strategy:
matrix:
include:
- arch: x86_64
os: ubuntu-latest
# skipped because github is being really slow about arm
# - arch: arm64
# os: ubuntu-24.04-arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Linux Host (x86_64)
if: matrix.container == false && matrix.arch == 'x86_64'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libwayland-bin libxkbcommon-dev zip
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target host
- name: Upload Linux Host (x86_64) artifact
if: matrix.container == false && matrix.arch == 'x86_64'
uses: actions/upload-artifact@v4
with:
name: host_linux_x86-64
path: build/host/null0
- name: Build Linux Hosts (arm64) - X11/Wayland and DRM
if: matrix.container == false && matrix.arch == 'arm64'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends curl git pkg-config cmake build-essential ninja-build zip \
libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev libwayland-dev libwayland-bin libxkbcommon-dev \
libdrm-dev libgbm-dev libegl1-mesa-dev libgles2-mesa-dev libasound2-dev libudev-dev libinput-dev clang
# Regular (desktop) build
cmake -B build_desktop -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1 \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS="-Wno-unknown-warning-option -Wno-unused-command-line-argument" \
-DCMAKE_CXX_FLAGS="-Wno-unknown-warning-option -Wno-unused-command-line-argument"
cmake --build build_desktop --target host
# DRM build
cmake -B build_drm -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DPLATFORM=DRM -DGRAPHICS=GRAPHICS_API_OPENGL_ES2 \
-DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1 \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_FLAGS="-Wno-unknown-warning-option -Wno-unused-command-line-argument" \
-DCMAKE_CXX_FLAGS="-Wno-unknown-warning-option -Wno-unused-command-line-argument"
cmake --build build_drm --target host
- name: Upload Linux Hosts (arm64) artifact
if: matrix.container == false && matrix.arch == 'arm64'
uses: actions/upload-artifact@v4
with:
name: host_linux_arm64
path: build_desktop/host/null0
- name: Upload Linux Hosts (drm_arm64) artifact
if: matrix.container == false && matrix.arch == 'arm64'
uses: actions/upload-artifact@v4
with:
name: host_linux_arm64_drm
path: build_drm/host/null0
host_mac:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build arm64
run: |
cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1
cmake --build build_arm64 --target host
- name: Build x86_64
run: |
cmake -B build_x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1
cmake --build build_x86_64 --target host
- name: Create universal binary
run: |
mkdir -p build_universal
lipo -create build_x86_64/host/null0 build_arm64/host/null0 -output build_universal/null0
chmod +x build_universal/null0
- name: Upload Mac Host artifact
uses: actions/upload-artifact@v4
with:
name: host_mac
path: build_universal/null0
host_windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build Native Windows Host (x64)
run: |
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl -DWAMR_BUILD_SIMD=0 -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1
cmake --build build --target host
shell: pwsh
- name: Upload Windows Host artifact
uses: actions/upload-artifact@v4
with:
name: host_windows
path: build/host/null0.exe
host_web:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 'latest'
- name: Build Web Host
run: npm run host:web
- name: Upload Web Host artifact
uses: actions/upload-artifact@v4
with:
name: host_web
path: wbuild/host/null0.mjs
cart_c:
name: C Carts
runs-on: ubuntu-latest
strategy:
matrix:
cart:
- colorbars
- example
- gradient
- input
- sfx
- speak
- wasi_demo
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build C ${{ matrix.cart }} cart
run: docker run -v ./carts/c/${{ matrix.cart }}:/src -v .:/out konsumer/null0-cart-c ${{ matrix.cart }}_c
- name: Upload C ${{ matrix.cart }} cart artifact
uses: actions/upload-artifact@v4
with:
name: cart_c_${{ matrix.cart }}
path: ${{ matrix.cart }}_c.null0
cart_js:
name: JS Carts
runs-on: ubuntu-latest
strategy:
matrix:
cart:
- demo
- input
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build JS ${{ matrix.cart }} cart
run: docker run -v ./carts/js/${{ matrix.cart }}:/src -v .:/out konsumer/null0-cart-quickjs ${{ matrix.cart }}_js
- name: Upload JS ${{ matrix.cart }} cart artifact
uses: actions/upload-artifact@v4
with:
name: cart_quickjs_${{ matrix.cart }}
path: ${{ matrix.cart }}_js.null0
cart_as:
name: Assemblyscript Carts
runs-on: ubuntu-latest
strategy:
matrix:
cart:
- simple
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Assemblyscript ${{ matrix.cart }} cart
run: docker run -v ./carts/as/${{ matrix.cart }}:/src -v .:/out konsumer/null0-cart-assemblyscript ${{ matrix.cart }}_as
- name: Upload Assemblyscript ${{ matrix.cart }} cart artifact
uses: actions/upload-artifact@v4
with:
name: cart_as_${{ matrix.cart }}
path: ${{ matrix.cart }}_as.null0
cart_nelua:
name: Nelua Carts
runs-on: ubuntu-latest
strategy:
matrix:
cart:
- basic
- colorbars
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Nelua ${{ matrix.cart }} cart
run: docker run -v ./carts/nelua/${{ matrix.cart }}:/src -v .:/out konsumer/null0-cart-nelua ${{ matrix.cart }}_nelua
- name: Upload Nelua ${{ matrix.cart }} cart artifact
uses: actions/upload-artifact@v4
with:
name: cart_nelua_${{ matrix.cart }}
path: ${{ matrix.cart }}_nelua.null0
# cart_nim:
# name: Nim Carts
# runs-on: ubuntu-latest
# strategy:
# matrix:
# cart:
# - simple
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Build Nim ${{ matrix.cart }} cart
# run: docker run -v ./carts/nim/${{ matrix.cart }}:/src -v .:/out konsumer/null0-cart-nim ${{ matrix.cart }}_nim
# - name: Upload Nim ${{ matrix.cart }} cart artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.cart }}_nim
# path: ${{ matrix.cart }}_nim.null0
# this creates a release on any tag, and attaches all the artifacts to it, then uploads demo page
release:
name: Release Tag
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs:
- cart_c
- cart_js
- cart_as
- cart_nelua
- host_linux
- host_mac
- host_windows
- host_web
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- run: ls -al artifacts
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
- name: Setup website
run: |
cd webroot
mv ../artifacts/null0.mjs .
mkdir -p carts
mv ../artifacts/**/*.null0 carts/
cd carts
ls *.null0 > list.txt
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload Pages
uses: actions/upload-pages-artifact@v3
with:
path: 'webroot'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4