-
Notifications
You must be signed in to change notification settings - Fork 23
76 lines (75 loc) · 2.11 KB
/
testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
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