Files
Diagon/.github/workflows/continuous-integration.yaml
T
Arthur Sonzogni b430bc5fdf Add emscripten build to the CI. (#17)
Build the project with emscripten and export as an archive.

This will help resolving
https://github.com/ArthurSonzogni/Diagon/issues/9
2021-03-20 19:04:38 +01:00

89 lines
2.3 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build and run tests
on:
- push
- pull_request
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
#- name: "Windows Latest - MSVC"
#os: windows-latest
#cc: "cl"
#cxx: "cl"
- name: "Ubuntu Latest - GCC"
os: ubuntu-latest
cc: "gcc-9"
cxx: "g++-9"
cmake: "cmake"
- name: "Ubuntu Latest - Clang"
os: ubuntu-latest
cc: "clang-9"
cxx: "clang++-9"
cmake: "cmake"
- name: "Ubuntu Latest - Emscripten"
os: ubuntu-latest
cc: "emcc"
cxx: "em++"
cmake: "emcmake cmake"
steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Set Windows ENV
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Install boost for windows
if: runner.os == 'Windows'
uses: MarkusJx/install-boost@v1.0.1
with:
boost_version: 1.73.0
- name: Setup Emscripten
if: ${{ matrix.config.cc == 'emcc' }}
uses: mymindstorm/setup-emsdk@v7
- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt install libboost-graph-dev
- name: Build
run: >
mkdir build;
${{ matrix.config.cmake }}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${{ matrix.config.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }};
make
- name: Tests
if: ${{ matrix.config.cc != 'emcc' }}
run: >
./input_output_test
- name: Make webAssembly distribution
if: ${{ matrix.config.cc == 'emcc' }}
run: >
mkdir -p distribution;
cp diagon.js distribution;
cp diagon.wasm distribution;
cp index.html distribution;
cp style.css distribution;
cp run_diagon.sh distribution;
chmod a+x ./distribution/run_diagon.sh
- name: Upload WebAssembly distribution
if: ${{ matrix.config.cc == 'emcc' }}
uses: actions/upload-artifact@v2
with:
name: distribution
path: distribution