-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (33 loc) · 1.04 KB
/
cmake.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
name: Build and Deploy C++ WebAssembly to GitHub Pages
on:
push:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v11
with:
version: latest
- name: Verify Emscripten Version
run: emcc -v
- name: Create Build Directory
run: mkdir build
- name: Configure and Build using CMake
run: |
cd build
emcmake cmake ..
cmake --build .
# Test to ensure that the web assembly runs without any errors.
- name: Test WebAssembly with emrun
run: |
emrun --no_browser --port 8080 web/index.html & # Start the server in the background
sleep 10 # Wait to ensure the server starts
kill %1 # Terminate the server process
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: web