-
Notifications
You must be signed in to change notification settings - Fork 340
76 lines (62 loc) · 2.4 KB
/
build-emscripten.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Emscripten build
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: ["windows-latest", "ubuntu-20.04", "macos-14"]
build_type: ["Debug", "Release"]
exclude:
# Exclude MacOS-Release
- os: "macos-14"
build_type: "Release"
include:
- os: "windows-latest"
build_type: "Release"
host_name: "Win10"
# Do not build WebGPU on Windows/Release as it is extremely slow
cmake_args: "-DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON -DDILIGENT_NO_WEBGPU=ON"
- os: "windows-latest"
build_type: "Debug"
host_name: "Win10"
cmake_args: "-DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON"
- os: "ubuntu-20.04"
host_name: "Linux"
cmake_args: "-DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON -DDILIGENT_EMSCRIPTEN_INCLUDE_COI_SERVICE_WORKER=ON"
- os: "macos-14"
host_name: "MacOS"
cmake_args: "-DDILIGENT_EMSCRIPTEN_STRIP_DEBUG_INFO=ON"
runs-on: ${{ matrix.os }}
name: ${{ matrix.host_name }} -> Emscripten, ${{ matrix.build_type }}
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up build environment
if: success()
uses: DiligentGraphics/github-action/setup-build-env@v1
with:
platform: Emscripten
- name: Configure CMake
if: success()
uses: DiligentGraphics/github-action/configure-cmake@v1
with:
build-type: ${{ matrix.build_type }}
cmake-args: ${{ matrix.cmake_args }}
- name: Build
if: success()
uses: DiligentGraphics/github-action/build@v1
- name: Pack Web Artifacts
if: ${{ success() && (matrix.host_name == 'Linux') && (matrix.build_type == 'Release') }}
working-directory: ${{github.workspace}}
run: |
python ./DiligentSamples/BuildTools/Emscripten/pack-artifacts.py -s ${{ env.DILIGENT_BUILD_DIR }}/DiligentSamples -o ./WebArtifacts
- name: Upload Web Artifacts
if: ${{ success() && (matrix.host_name == 'Linux') && (matrix.build_type == 'Release') }}
uses: actions/upload-artifact@v4
with:
name: WasmModules-DiligentGraphics.github.io
path: |
${{github.workspace}}/WebArtifacts
retention-days: 14