forked from chocolate-doom/chocolate-doom
-
Notifications
You must be signed in to change notification settings - Fork 133
142 lines (125 loc) · 3.41 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Continuous Integration
on:
push:
branches:
- "master"
paths-ignore:
- "**.md"
pull_request:
branches:
- "master"
paths-ignore:
- "**.md"
workflow_dispatch:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- name: Linux GCC
os: ubuntu-latest
compiler: gcc
shell: bash
- name: macOS Clang
os: macos-latest
compiler: clang
shell: bash
- name: MSYS2 UCRT64
os: windows-latest
compiler: gcc
shell: 'msys2 {0}'
msystem: ucrt64
msys-env: mingw-w64-ucrt-x86_64
- name: MSYS2 MINGW32
os: windows-latest
compiler: gcc
shell: 'msys2 {0}'
msystem: mingw32
msys-env: mingw-w64-i686
steps:
- name: Install pandoc
if: runner.os == 'Windows'
shell: cmd
run: choco install pandoc
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
libsdl2-dev \
libsdl2-mixer-dev \
libsdl2-net-dev \
libpng-dev \
libsamplerate0-dev \
libfluidsynth-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install \
automake \
dylibbundler \
sdl2 \
sdl2_mixer \
sdl2_net \
libpng \
libsamplerate \
fluid-synth
- name: Install dependencies (MSYS2)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
update: false
path-type: inherit
install: >-
autotools
zip
${{ matrix.config.msys-env }}-gcc
${{ matrix.config.msys-env }}-SDL2
${{ matrix.config.msys-env }}-SDL2_mixer
${{ matrix.config.msys-env }}-SDL2_net
${{ matrix.config.msys-env }}-libpng
${{ matrix.config.msys-env }}-libsamplerate
${{ matrix.config.msys-env }}-fluidsynth
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
env:
CC: ${{ matrix.config.compiler }}
run: |
./autogen.sh
- name: Build
run: make -j4
- name: Test
run: |
PREFIX=`sed -n '/PROGRAM_PREFIX/p' ${PWD}/config.h | cut -d '"' -f 2`
make -j4 -C quickcheck check SOURCE_PORT=$PWD/src/${PREFIX}doom
- name: Package (macOS)
if: runner.os == 'macOS'
run: |
cd pkg/osx
make
- name: Package (MSYS2)
if: runner.os == 'Windows'
run: |
cd pkg/win32
make
- name: Upload artifacts (macOS)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v3
with:
name: macOS
path: pkg/osx/*.dmg
- name: Upload artifacts (MSYS2)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: Win-${{ matrix.config.msystem }}
path: pkg/win32/*.zip