-
Notifications
You must be signed in to change notification settings - Fork 159
75 lines (62 loc) · 2.85 KB
/
build.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
name: GitHub Actions Build
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build:
name: ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Windows-mingw64, os: windows-latest, artifact: 'ags-mingw64', shell: 'msys2 {0}', runbin: "./ags", bindir: "", msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Windows, os: windows-latest, artifact: 'ags-windows', shell: cmd, runbin: ".\\ags.exe", bindir: "Release" }
- { name: Ubuntu, os: ubuntu-latest, artifact: 'ags-linux', shell: sh, runbin: "./ags", bindir: "" }
- { name: macOS, os: macos-latest, artifact: 'ags-macos', shell: sh, runbin: "./ags", bindir: "" }
steps:
- name: Set up MSYS2
if: matrix.platform.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: >-
${{ matrix.platform.msys-env }}-cc
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-ninja
${{ matrix.platform.msys-env }}-perl
${{ matrix.platform.msys-env }}-python-pip
${{ matrix.platform.msys-env }}-pkg-config
${{ matrix.platform.msys-env }}-clang-tools-extra
- name: Set up Tappy
run: pip install tap.py
- uses: actions/checkout@v4
- name: Configure CMake
run: |
cmake --version
cmake -S "${{github.workspace}}" -B "${{github.workspace}}/build" -DAGS_BUILD_TOOLS=1 -DAGS_TESTS=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --parallel 2
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.artifact }}
path: |
${{github.workspace}}/build/${{env.BUILD_TYPE}}/ags.exe
${{github.workspace}}/build/ags
${{github.workspace}}/build/ags.exe
- name: Run game auto-test
working-directory: ${{github.workspace}}/build/${{matrix.platform.bindir}}
run: |
curl -sLo auto-test.ags https://github.com/adventuregamestudio/ags-test-games/releases/latest/download/ags3-auto-test.ags
${{matrix.platform.runbin}} --no-message-box --log-stdout=script:info,main:info --user-data-dir . auto-test.ags
- name: Check auto-test # we are using tap.py so that the pipeline fails if a test fails
working-directory: ${{github.workspace}}/build/${{matrix.platform.bindir}}
run: |
tappy agstest.tap