9
9
10
10
jobs :
11
11
build :
12
- runs-on : ${{ matrix.platform }}
12
+ runs-on : ${{ matrix.os }}
13
13
14
14
strategy :
15
15
fail-fast : false
16
16
matrix :
17
- platform : [macos-latest, ubuntu-latest]
17
+ os : [macos-latest, ubuntu-latest]
18
+ platform : [native, web]
18
19
build-type : [debug, release]
19
20
20
21
steps :
21
22
- uses : actions/checkout@v4
22
23
with :
23
- fetch-depth : 0
24
- submodules : true
24
+ fetch-depth : 1
25
+ submodules : false
25
26
26
27
# Install Vcpkg (submodule seems not working?)
27
28
- uses : actions/checkout@v4
28
29
with :
29
30
repository : ' microsoft/vcpkg'
30
31
path : ' vcpkg'
31
32
32
- # Install Emsdk
33
- # - uses: actions/checkout@v4
34
- # with:
35
- # repository: 'emscripten-core/emsdk'
36
- # path: 'emsdk'
37
-
38
33
- name : Set strings
39
34
id : strings
40
35
run : |
41
36
echo "build-dir=${{ github.workspace }}/build" >> $GITHUB_OUTPUT
37
+ echo "build-dir-web=${{ github.workspace }}/build-wasm" >> $GITHUB_OUTPUT
42
38
43
39
- name : Bootstrap vcpkg
44
40
run : |
45
41
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh
46
42
47
43
- name : Install CMake on Ubuntu
48
- if : matrix.platform == 'ubuntu-latest'
44
+ if : matrix.os == 'ubuntu-latest'
49
45
run : |
50
46
sudo apt-get update
51
47
sudo apt-get install -y cmake
52
48
53
49
- name : Install CMake on macOS
54
- if : matrix.platform == 'macos-latest'
50
+ if : matrix.os == 'macos-latest'
55
51
run : |
56
52
brew install cmake
57
53
58
- - name : Set up EMSDK
54
+ - name : Install EMSDK
55
+ if : matrix.platform == 'web'
59
56
run : |
60
57
git clone https://github.com/emscripten-core/emsdk.git
61
- ${{ github.workspace }}/emsdk install latest
62
- ${{ github.workspace }}/emsdk activate latest
58
+ ${{ github.workspace }}/emsdk/emsdk install latest
59
+ ${{ github.workspace }}/emsdk/emsdk activate latest
63
60
echo "EMSDK="${{ github.workspace }}/emsdk" >> $GITHUB_ENV
64
61
65
- - name : CMake Configure
62
+ - name : CMake Configure for Native
63
+ if : matrix.platform == 'native'
66
64
run : >
67
65
cmake -S ${{ github.workspace }}
68
66
-B ${{ steps.strings.outputs.build-dir }}
69
67
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
70
68
71
- - name : CMake Build
72
- run : cmake --build ${{ steps.strings.outputs.build-dir }}
69
+ - name : CMake Build for Native
70
+ if : matrix.platform == 'native'
71
+ run : cmake --build ${{ steps.strings.outputs.build-dir }}
72
+
73
+ - name : CMake Configure for Web
74
+ if : matrix.platform == 'web'
75
+ run : >
76
+ cmake -S ${{ github.workspace }}
77
+ -B ${{ steps.strings.outputs.build-dir-web }}
78
+ -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
79
+ -DEMSCRIPTEN=ON
80
+
81
+ - name : CMake Build for Web
82
+ if : matrix.platform == 'web'
83
+ run : cmake --build ${{ steps.strings.outputs.build-dir-web }}
0 commit comments