-
Notifications
You must be signed in to change notification settings - Fork 32
47 lines (37 loc) · 1.27 KB
/
build-web.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
name: 🌐 Build Web
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
BUILD_TYPE: Release
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: "${{ github.workspace }}/.ccache"
CCACHE_COMPILERTYPE: emcc
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/cmake/Emscripten.cmake
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install emsdk
uses: mymindstorm/setup-emsdk@v14
- name: Get timestamp
shell: bash
id: ccache_vars
run: |
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCUBOS_CORE_SAMPLES=ON -DCUBOS_ENGINE_SAMPLES=ON -DCMAKE_TOOLCHAIN_FILE=${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
shell: bash
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all
- name: Copy results
run: cp ${{github.workspace}}/build/*.{js,wasm,html} ${{github.workspace}}/results
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: emscripten
path: ${{github.workspace}}/results