-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (42 loc) · 1.4 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
43
44
45
46
47
48
49
50
51
52
53
54
name: Build and Deploy C++ WebAssembly
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_TYPE: Release
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- 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: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: emcmake cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{env.BUILD_TYPE}}
- name: Run tests
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
- name: Test WebAssembly with emrun
run: |
emrun --no_browser --port 8080 CompilerEditor/index.html &
sleep 10
curl -sSf http://localhost:8080/index.html > /dev/null
kill %1
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: CompilerEditor