-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (85 loc) · 2.76 KB
/
main.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Build
on: [push, pull_request]
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 (MSVC), os: windows-2019, shell: sh, msvc: 1 }
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Linux, os: ubuntu-22.04, shell: sh }
- { name: Macos, os: macos-latest, shell: sh }
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 }}-SDL2
${{ matrix.platform.msys-env }}-cmake
${{ matrix.platform.msys-env }}-gcc
${{ matrix.platform.msys-env }}-ninja
- name: Setup Macos dependencies
if: runner.os == 'macOS'
run: |
brew install \
sdl2 \
ninja \
${NULL+}
- name: Setup Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get -y install \
cmake \
libsdl2-dev \
ninja-build \
pkg-config \
${NULL+}
- uses: actions/checkout@v3
- name: Setup MSVC dependencies
if: "matrix.platform.msvc"
shell: pwsh
run: |
echo "::group::Downloading SDL"
.github/fetch_sdl_vc.ps1
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/SDL2-devel-VC" >> $Env:GITHUB_ENV
echo "::endgroup::"
- name: Setup Ninja for MSVC
if: "matrix.platform.msvc"
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.10.2
- uses: ilammy/msvc-dev-cmd@v1
if: "matrix.platform.msvc"
with:
arch: x64
- name: Configure (CMake)
run: |
cmake -S . -B build \
-DSDLGESTURE_TESTS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=prefix
- name: Build (CMake)
run: |
cmake --build build/ --config Release --parallel --verbose
- name: Install (CMake)
run: |
set -eu
rm -fr prefix_cmake
cmake --install build/ --config Release
( cd prefix; find . ) | LC_ALL=C sort -u
- name: Verify CMake configuration files
run: |
cmake -S test -B cmake_config_build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$PWD/prefix"
cmake --build cmake_config_build --verbose --config Release