name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build-linux:
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true

    - name: Install dependencies
      run: sudo apt update && sudo apt install --yes libfmt-dev libgflags-dev libgtest-dev build-essential cmake ninja-build

    - name: Build
      run: |
        mkdir -p build && cd build
        cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
        cmake --build .

  build-windows:
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true

    - uses: actions/cache@v2
      id: vcpkg-cache
      with:
        path: ~\AppData\Local\vcpkg\archives
        key: vcpkg-cache

    - name: Build
      run: |
        mkdir build
        cd build
        cmake -DCMAKE_TOOLCHAIN_FILE=C:\Vcpkg\scripts\buildsystems\vcpkg.cmake ..
        cmake --build .

name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build-linux:
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true

    - name: Install dependencies
      run: sudo apt update && sudo apt install --yes libfmt-dev libgflags-dev libgtest-dev build-essential cmake ninja-build

    - name: Build
      run: |
        mkdir -p build && cd build
        cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
        cmake --build .

  build-windows:
    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true

    - uses: actions/cache@v2
      id: vcpkg-cache
      with:
        path: ~\AppData\Local\vcpkg\archives
        key: vcpkg-cache

    - name: Build
      run: |
        mkdir build
        cd build
        cmake -DCMAKE_TOOLCHAIN_FILE=C:\Vcpkg\scripts\buildsystems\vcpkg.cmake ..
        cmake --build .

  build-emscripten:
    runs-on: ubuntu-20.04

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true

    - name: Setup emsdk
      uses: mymindstorm/setup-emsdk@v6
      with:
        version: 1.39.20
        actions-cache-folder: 'emsdk-cache'

    - name: Build
      run: |
        mkdir -p build
        emcmake cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING_EMULATOR=$(which node) .
        cmake --build build

Add CI for the emscripten build.
Add CI for the emscripten build.

Signed-off-by: Roberto Raggi <5b38c5be65ca2d75b92c40e91029e90f276fd4fe@gmail.com>
