-
-
Notifications
You must be signed in to change notification settings - Fork 27
111 lines (92 loc) · 3.48 KB
/
Copy pathemscripten_build.yml
File metadata and controls
111 lines (92 loc) · 3.48 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
# Manual runs only — does NOT run on push to main.
# Protects https://micropolisweb.com/ during development: merge freely; publish only when ready.
#
# Actions → Build Wasm Library with Emscripten → Run workflow
#
# What this does:
# 1. Build C++/WASM engine (packages/micropolis-engine → make install)
# 2. Run Vitest suite against real WASM (pnpm --filter micropolis run test)
# 3. Verify monorepo structure invariants (pnpm run verify:structure)
# 4. Optionally generate Doxygen C++ API docs
# 5. Build SvelteKit app (pnpm --filter micropolis run build) — includes Jekyll
# 6. Deploy to GitHub Pages ONLY if you check "Deploy to GitHub Pages" (default: off)
name: Build Wasm Library with Emscripten
on:
workflow_dispatch:
inputs:
include_doxygen:
description: Generate Doxygen C++ API HTML and publish it at /doc on Pages
type: boolean
default: true
deploy_to_pages:
description: >-
Deploy build to GitHub Pages (micropolisweb.com). Leave unchecked while
developing — verify the build first, then re-run with this enabled.
type: boolean
default: false
permissions:
contents: write
concurrency:
group: micropolis-pages-deploy
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Emscripten toolchain
uses: mymindstorm/setup-emsdk@v14
- name: Install Doxygen
if: ${{ inputs.include_doxygen }}
run: sudo apt-get update && sudo apt-get install -y doxygen
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- uses: pnpm/action-setup@v4
- name: Install monorepo dependencies
run: pnpm install --frozen-lockfile
- name: Build C++/WASM engine (packages/micropolis-engine → make install)
run: |
emcc --version
pnpm --filter @micropolis/engine-wasm run build
- name: Verify monorepo structure
run: pnpm run verify:structure
- name: Run Micropolis Vitest suite
run: pnpm --filter micropolis run test
- name: Build optional Doxygen C++ API docs
if: ${{ inputs.include_doxygen }}
run: |
doxygen Doxyfile 2>doxygen_warnings >/dev/null
echo "Doxygen warnings:"
cat doxygen_warnings || true
- name: Setup Ruby (for Jekyll)
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
working-directory: apps/micropolis/website
bundler-cache: true
- name: Build SvelteKit app (Jekyll → _jekyll_content_build, Vite → build/)
# Calls build:jekyll then build:svelte directly — avoids triggering the
# prebuild hook (which would re-run make install) while keeping builds ordered.
run: |
cd apps/micropolis
pnpm run build:jekyll
pnpm run build:svelte
- name: Assemble Pages output
run: |
mkdir -p _site/doc
cp -r apps/micropolis/build/. _site/
if [ "${{ inputs.include_doxygen }}" = "true" ] && [ -d html ]; then
cp -r html/. _site/doc/
fi
- name: Deploy to GitHub Pages
if: >-
success() &&
github.ref == 'refs/heads/main' &&
inputs.deploy_to_pages == true
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site