mirror of
https://github.com/ArthurSonzogni/Diagon.git
synced 2026-08-30 00:50:45 +08:00
b430bc5fdf
Build the project with emscripten and export as an archive. This will help resolving https://github.com/ArthurSonzogni/Diagon/issues/9
89 lines
2.3 KiB
YAML
89 lines
2.3 KiB
YAML
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
|