Skip to content

Commit fd1a337

Browse files
WIP10: Add github CI
1 parent 391ccf3 commit fd1a337

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

.github/workflows/.github.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,64 +9,75 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ${{ matrix.platform }}
12+
runs-on: ${{ matrix.os }}
1313

1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
platform: [macos-latest, ubuntu-latest]
17+
os: [macos-latest, ubuntu-latest]
18+
platform: [native, web]
1819
build-type: [debug, release]
1920

2021
steps:
2122
- uses: actions/checkout@v4
2223
with:
23-
fetch-depth: 0
24-
submodules: true
24+
fetch-depth: 1
25+
submodules: false
2526

2627
# Install Vcpkg (submodule seems not working?)
2728
- uses: actions/checkout@v4
2829
with:
2930
repository: 'microsoft/vcpkg'
3031
path: 'vcpkg'
3132

32-
# Install Emsdk
33-
# - uses: actions/checkout@v4
34-
# with:
35-
# repository: 'emscripten-core/emsdk'
36-
# path: 'emsdk'
37-
3833
- name: Set strings
3934
id: strings
4035
run: |
4136
echo "build-dir=${{ github.workspace }}/build" >> $GITHUB_OUTPUT
37+
echo "build-dir-web=${{ github.workspace }}/build-wasm" >> $GITHUB_OUTPUT
4238
4339
- name: Bootstrap vcpkg
4440
run: |
4541
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh
4642
4743
- name: Install CMake on Ubuntu
48-
if: matrix.platform == 'ubuntu-latest'
44+
if: matrix.os == 'ubuntu-latest'
4945
run: |
5046
sudo apt-get update
5147
sudo apt-get install -y cmake
5248
5349
- name: Install CMake on macOS
54-
if: matrix.platform == 'macos-latest'
50+
if: matrix.os == 'macos-latest'
5551
run: |
5652
brew install cmake
5753
58-
- name: Set up EMSDK
54+
- name: Install EMSDK
55+
if: matrix.platform == 'web'
5956
run: |
6057
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
6360
echo "EMSDK="${{ github.workspace }}/emsdk" >> $GITHUB_ENV
6461
65-
- name: CMake Configure
62+
- name: CMake Configure for Native
63+
if: matrix.platform == 'native'
6664
run: >
6765
cmake -S ${{ github.workspace }}
6866
-B ${{ steps.strings.outputs.build-dir }}
6967
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
7068
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

Comments
 (0)