-
Notifications
You must be signed in to change notification settings - Fork 21
106 lines (100 loc) · 3.48 KB
/
test.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
push:
branches-ignore:
- 'screenshots'
paths:
- '**'
- '!**.md'
- '!doc/**'
- '!schema/**'
- '!api/lua/definition/**'
- '!.github/workflows/**'
- '.github/workflows/test.yaml'
pull_request:
branches-ignore:
- 'screenshots'
paths:
- '**'
- '!**.md'
- '!doc/**'
- '!schema/**'
- '!api/lua/definition/**'
- '!.github/workflows/**'
- '.github/workflows/test.yaml'
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-latest]
shell: [bash]
extra_make_args: [''] # default build
include:
- os: windows-latest
shell: msys2 {0}
extra_make_args: ''
- os: macos-13
shell: bash
# we now require 10.15 by default, but 10.13 should work with an extra dependency
extra_make_args: 'MACOS_DEPLOYMENT_TARGET=10.13'
name: Test ${{ matrix.os }} ${{ matrix.extra_make_args }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Install dependencies (apt)
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt-get update -y -qq
sudo apt-get install coreutils build-essential libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libgtest-dev
- name: Install dependencies (brew)
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
brew install coreutils SDL2 sdl2_ttf sdl2_image openssl@1.1 googletest || true
- name: Install extra dependencies (brew)
if: ${{ startsWith(matrix.os, 'macos') && contains(matrix.extra_make_args, 'MACOS_DEPLOYMENT_TARGET') }}
run: |
brew install boost || true
- name: Install dependencies (msys2)
if: ${{ startsWith(matrix.os, 'windows') }}
uses: msys2/setup-msys2@v2
with:
release: false
update: true
install: >-
base-devel
coreutils
make
mingw-w64-x86_64-toolchain
mingw64/mingw-w64-x86_64-SDL2
mingw64/mingw-w64-x86_64-SDL2_image
mingw64/mingw-w64-x86_64-SDL2_ttf
mingw64/mingw-w64-x86_64-freetype
mingw64/mingw-w64-x86_64-openssl
mingw64/mingw-w64-x86_64-gtest
p7zip
- name: Fix dependencies (msys2)
if: ${{ startsWith(matrix.os, 'windows') }}
run: |
# static svt-av1 2.3.0-1 lib seems to be currently broken
wget https://quantum-mirror.hu/mirrors/pub/msys2/mingw/mingw64/mingw-w64-x86_64-svt-av1-2.2.1-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-svt-av1-2.2.1-1-any.pkg.tar.zst
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure ASAN (macos-latest)
if: ${{ startsWith(matrix.os, 'macos-latest') }}
run: |
# see https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow#false-positives
# since we don't build gtest with ASAN, we hit this issue on macos-latest
echo "ASAN_OPTIONS=detect_container_overflow=0" >> $GITHUB_ENV
- name: Enable ASAN
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
# we use mingw on windows, which does not support ASAN
echo "extra_make_args=WITH_ASAN=true ${{ matrix.extra_make_args }}" >> $GITHUB_ENV
- name: Build DEBUG
run: make native CONF=DEBUG ${{ env.extra_make_args }} -j4
- name: Run tests
run: make test CONF=DEBUG ${{ env.extra_make_args }} -j4