Reworked how tolua++ is compiled #1396
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test on GNU/Linux | |
'on': | |
- push | |
- pull_request | |
- workflow_dispatch | |
env: | |
BUILD_DIR: ${{ github.workspace }}/build/ | |
BUILD_TYPE: Release | |
CMAKE_FLAGS: >- | |
-DENABLE_STATIC=OFF | |
-DOpenGL_GL_PREFERENCE=GLVND | |
-DWITH_GEOJSON=OFF | |
-DWITH_X11=ON | |
-DWITH_WARNINGS_AS_ERRORS=ON | |
WYRMSUN_URL: https://github.com/Andrettin/Wyrmsun | |
WYRMSUN_BRANCH: master | |
DISPLAY: :0 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
container: | |
- andrettin/wyrmgus:jammy | |
container: ${{ matrix.container }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Set CPU number | |
run: echo "THREADS=$(nproc)" >> "$GITHUB_ENV" | |
- name: Configure CMake | |
run: >- | |
cmake | |
-S "$GITHUB_WORKSPACE" | |
-B "$BUILD_DIR" | |
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" | |
$CMAKE_FLAGS | |
- name: Workaround for tolua.cpp target on CMake 3.16.3 | |
run: cmake -S "$GITHUB_WORKSPACE" -B "$BUILD_DIR" | |
- name: Build Wyrmgus | |
run: >- | |
cmake | |
--build "$BUILD_DIR" | |
--target wyrmgus_main | |
--parallel "$THREADS" | |
- name: Build Wyrmgus test suite | |
run: >- | |
cmake | |
--build "$BUILD_DIR" | |
--target wyrmgus_test | |
--parallel "$THREADS" | |
- name: Test | |
continue-on-error: true | |
run: cmake --build "$BUILD_DIR" --target test | |
- name: Clone Wyrmsun data | |
run: | | |
git clone "$WYRMSUN_URL" "${BUILD_DIR}/Wyrmsun/" | |
git -C "${BUILD_DIR}/Wyrmsun/" checkout "$WYRMSUN_BRANCH" | |
- name: Configure ALSA | |
run: >- | |
echo 'pcm.!default { type plug slave.pcm "null"; }' | |
> /etc/asound.conf | |
- name: Run graphic server | |
run: | | |
Xvfb "$DISPLAY" & | |
display_num=$(echo "$DISPLAY" | cut -c 2-) | |
while [ ! -S "/tmp/.X11-unix/X${display_num}" ]; do sleep 1; done | |
timeout-minutes: 5 | |
- name: Run Wyrmsun | |
run: >- | |
"${BUILD_DIR}/wyrmgus" -t -d "${BUILD_DIR}/Wyrmsun/" | |
timeout-minutes: 5 |