summaryrefslogtreecommitdiff
path: root/.github/workflows/ci-build.yml
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2020-12-05 21:57:47 +0100
committerPatric Stout <github@truebrain.nl>2020-12-15 15:46:39 +0100
commitd15dc9f40f5a20bff452547a2dcb15231f9f969d (patch)
tree7b8d88635c048d906cbb6358007fb26055e24410 /.github/workflows/ci-build.yml
parent2da07f76154d841bcfe9aaff4833144550186deb (diff)
downloadopenttd-d15dc9f40f5a20bff452547a2dcb15231f9f969d.tar.xz
Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via HTML / JavaScript. This allows you to play OpenTTD inside a browser. Co-authored-by: milek7 <me@milek7.pl>
Diffstat (limited to '.github/workflows/ci-build.yml')
-rw-r--r--.github/workflows/ci-build.yml49
1 files changed, 49 insertions, 0 deletions
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 31d0b511d..8794b79da 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -10,6 +10,55 @@ env:
CTEST_OUTPUT_ON_FAILURE: 1
jobs:
+ emscripten:
+ name: Emscripten
+
+ runs-on: ubuntu-20.04
+ container:
+ # If you change this version, change the number in the cache step too.
+ image: emscripten/emsdk:2.0.10
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Setup cache
+ uses: actions/cache@v2
+ with:
+ path: /emsdk/upstream/emscripten/cache
+ key: 2.0.10-${{ runner.os }}
+
+ - name: Build (host tools)
+ run: |
+ mkdir build-host
+ cd build-host
+
+ echo "::group::CMake"
+ cmake .. -DOPTION_TOOLS_ONLY=ON
+ echo "::endgroup::"
+
+ echo "::group::Build"
+ echo "Running on $(nproc) cores"
+ make -j$(nproc) tools
+ echo "::endgroup::"
+
+ - name: Install GCC problem matcher
+ uses: ammaraskar/gcc-problem-matcher@master
+
+ - name: Build
+ run: |
+ mkdir build
+ cd build
+
+ echo "::group::CMake"
+ emcmake cmake .. -DHOST_BINARY_DIR=../build-host
+ echo "::endgroup::"
+
+ echo "::group::Build"
+ echo "Running on $(nproc) cores"
+ emmake make -j$(nproc)
+ echo "::endgroup::"
+
linux:
name: Linux