name: CI (Emscripten) on: workflow_call: env: CTEST_OUTPUT_ON_FAILURE: 1 jobs: emscripten: name: CI runs-on: ubuntu-20.04 container: # If you change this version, change the number in the cache step too. image: emscripten/emsdk:3.1.42 steps: - name: Checkout if: github.event_name != 'workflow_dispatch' uses: actions/checkout@v4 - name: Checkout (Manual) if: github.event_name == 'workflow_dispatch' uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.ref }} - name: Setup cache uses: actions/cache@v4 with: path: /emsdk/upstream/emscripten/cache key: 3.1.42-${{ runner.os }} - name: Patch Emscripten to support LZMA run: | cd /emsdk/upstream/emscripten patch -p1 < ${GITHUB_WORKSPACE}/os/emscripten/emsdk-liblzma.patch - 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" cmake --build . -j $(nproc) --target 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" cmake --build . -j $(nproc) --target openttd echo "::endgroup::"