Skip to content

WIP9: Add github CI

WIP9: Add github CI #9

Workflow file for this run

name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest]
build-type: [debug, release]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
# Install Vcpkg (submodule seems not working?)
- uses: actions/checkout@v4
with:
repository: 'microsoft/vcpkg'
path: 'vcpkg'
# Install Emsdk
# - uses: actions/checkout@v4
# with:
# repository: 'emscripten-core/emsdk'
# path: 'emsdk'
- name: Set strings
id: strings
run: |
echo "build-dir=${{ github.workspace }}/build" >> $GITHUB_OUTPUT
- name: Bootstrap vcpkg
run: |
${{ github.workspace }}/vcpkg/bootstrap-vcpkg.sh
- name: Install CMake on Ubuntu
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y cmake
- name: Install CMake on macOS
if: matrix.platform == 'macos-latest'
run: |
brew install cmake
- name: Set up EMSDK
run: |
git clone https://github.com/emscripten-core/emsdk.git
${{ github.workspace }}/emsdk install latest
${{ github.workspace }}/emsdk activate latest
echo "EMSDK="${{ github.workspace }}/emsdk" >> $GITHUB_ENV
- name: CMake Configure
run: >
cmake -S ${{ github.workspace }}
-B ${{ steps.strings.outputs.build-dir }}
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: CMake Build
run: cmake --build ${{ steps.strings.outputs.build-dir }}