-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (62 loc) · 2.28 KB
/
Copy pathpages.yml
File metadata and controls
72 lines (62 loc) · 2.28 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
name: GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: Build direct root playable game
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Build root artifact
run: bash scripts/build_web.sh dist
- name: Verify direct root artifact
run: |
test -s dist/index.html
test -s dist/neural_boundary_web.wasm
grep -q "DIRECT ROOT RUN" dist/index.html
grep -q "Run Game" dist/index.html
grep -q "nbg_new" dist/index.html
grep -q "nbg_tick" dist/index.html
grep -q "nbg_set_action" dist/index.html
grep -q "0x070900" dist/index.html
- name: Verify WASM exports
run: |
node <<'NODE'
const fs = require("fs");
WebAssembly.instantiate(fs.readFileSync("dist/neural_boundary_web.wasm"), {}).then(({instance}) => {
const e = instance.exports;
for (const n of ["nbg_abi_version","nbg_product_version_packed","nbg_health_check","nbg_new","nbg_tick","nbg_set_action","nbg_score","nbg_grade","nbg_state_hash_hi","nbg_state_hash_lo"]) {
if (typeof e[n] !== "function") throw new Error("missing " + n);
}
if (e.nbg_abi_version() !== 3) throw new Error("bad ABI");
if (e.nbg_product_version_packed() !== 0x070900) throw new Error("bad version");
if (e.nbg_health_check() !== 0x070900) throw new Error("bad health");
if (e.nbg_new(1, 0x12345678, 0x9abcdef0) !== 1) throw new Error("new failed");
e.nbg_set_action(1);
e.nbg_tick();
console.log("OK", e.nbg_score(), e.nbg_state_hash_hi(), e.nbg_state_hash_lo());
}).catch(e => { console.error(e); process.exit(1); });
NODE
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
name: Deploy direct root playable game
needs: build
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4