forked from gemrb/gemrb
-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (164 loc) · 6.41 KB
/
builder.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Builders
on:
push:
branches: [ master ]
tags: [ '**' ]
pull_request:
branches: [ master ]
jobs:
macos:
name: MacOS build
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Homebrew
run: |
brew install sdl2 openal-soft sdl2_mixer libpng libvorbis sccache googletest
brew reinstall libpng
- name: Set up build
run: |
# FindOpenAL prefers the framework version by default ... which deprecated OpenAL
openal="-DOPENAL_INCLUDE_DIR=/usr/local/opt/openal-soft/include/AL -DOPENAL_LIBRARY=/usr/local/opt/openal-soft/lib/libopenal.dylib"
mkdir build && cd build &&
export OPENALDIR="/usr/local/opt/openal-soft/" &&
cmake --version &&
cmake -DCMAKE_INSTALL_PREFIX=iprefix $openal -DCMAKE_FIND_FRAMEWORK=LAST -DUSE_OPENAL=off -DUSE_TESTS=ON ..
grep -i openal CMakeCache.txt
- name: Compiler cache (sccache)
uses: actions/cache@v3
with:
path: |
~/.cache/sccache
~/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-sccache-v1-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-sccache-v1-${{ github.ref }}-
${{ runner.os }}-sccache-v1-refs/heads/master-
${{ runner.os }}-sccache-v1-
- name: Build & Test
run: |
cd build &&
make &&
make test &&
# try to only run on tag pushes
if grep -q '^v[01]\.[0-9].[0-9]' <<< "${GITHUB_REF}"; then make fetch-demo-data; fi &&
make install
- name: Show build cache stats
run: |
command -v sccache &&
sccache -s
- name: Set up SSH
uses: kielabokkie/ssh-key-and-known-hosts-action@v1
if: github.event_name == 'push'
with:
ssh-private-key: ${{ secrets.SSH_SF_PRIVATE_KEY }}
ssh-host: frs.sourceforge.net
- name: Upload
if: github.event_name == 'push'
run: |
# NOTE: only do it on clang builds if we ever add more compilers
filepath=Apple/OSX
tarpath=/Applications/GemRB.app
# there are no tags, so improvise
version=$({ date +%F; git describe --always; } | tr -d '\n') || exit 14
file=gemrb-$version.tar.bz2
tar cjf $file $tarpath || exit 15
filepath="$filepath/$file"
scp $file \
[email protected]:/home/frs/project/gemrb/Buildbot\\\ Binaries/$filepath
linux:
name: Linux AppImage build
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install zlib1g zlib1g-dev libsdl2-2.0-0 libsdl2-dev libopenal1 libopenal-dev libsdl2-mixer-dev libfreetype6 libfreetype6-dev libvlc-dev libpng16-16 libpng-dev libvorbis0a libvorbis-dev python3-dev zstd g++-7 gdb libgtest-dev
SCCACHE_VERSION="v0.2.15"
SCCACHE_LINUX_PACKAGE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl"
curl -sSfL "https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_LINUX_PACKAGE}.tar.gz" | sudo tar zx --strip-component=1 -C /usr/bin/
chmod +x /usr/bin/sccache
- name: Set up build
env:
CXX: g++-7
CC: gcc-7
run: |
mkdir build && cd build
cmake --version
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DSTATIC_LINK=1 -DAPPIMAGE=1 -DUSE_TESTS=ON
- name: Compiler cache (sccache)
uses: actions/cache@v3
with:
path: |
~/.cache/sccache
~/Library/Caches/Mozilla.sccache
key: ${{ runner.os }}-sccache-v1-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-sccache-v1-${{ github.ref }}-
${{ runner.os }}-sccache-v1-refs/heads/master-
${{ runner.os }}-sccache-v1-
- name: Build
run: |
cd build
make
# install big demo data only on tag pushes
if grep -q '^v[01]\.[0-9].[0-9]' <<< "${GITHUB_REF}"; then make fetch-demo-data; fi
# create a debugging runner, since xvfb runs one command per process only
echo "ulimit -Sc unlimited; sudo sysctl -w kernel.core_pattern=$PWD/core-%e" >> run-or-dump.sh
echo 'if ! gemrb/gemrb -q --color 2 -c ../gemrb/GemRB.cfg.noinstall.sample; then' >> run-or-dump.sh
echo 'gdb -q -c core-* -ex bt -ex q -batch --args gemrb/gemrb -q -c ../gemrb/GemRB.cfg.noinstall.sample' >> run-or-dump.sh
echo "exit 1; fi" >> run-or-dump.sh
chmod +x run-or-dump.sh
- name: Test Suite
run: |
cd build
make test
- name: Test Run
uses: coactions/setup-xvfb@v1
with:
run: ./run-or-dump.sh
working-directory: build
- name: Prepare AppImage
run: |
cd build
# fetch appimage tools
curl https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -L -o linuxdeploy
curl https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage -L -o appimagelint
chmod +x linuxdeploy appimagelint
chmod +x linuxdeploy
echo "::group::AppImage building"
make appimage
ln -s GemRB-*.AppImage grrr-gemrb.AppImage # workaround for xvfb
echo "::endgroup::"
# check if it works on old systems
echo "::group::AppImage conformance testing"
./appimagelint GemRB-*.AppImage
echo "::endgroup::"
- name: Test AppImage
uses: coactions/setup-xvfb@v1
with:
run: ./grrr-gemrb.AppImage -q ../gemrb/tests/minimal/
working-directory: build
- name: Show build cache stats
run: |
command -v sccache
sccache -s
- name: Set up SSH
uses: kielabokkie/ssh-key-and-known-hosts-action@v1
if: github.event_name == 'push'
with:
ssh-private-key: ${{ secrets.SSH_SF_PRIVATE_KEY }}
ssh-host: frs.sourceforge.net
- name: Upload
if: github.event_name == 'push'
run: |
# NOTE: only do it on gcc builds if we ever add more compilers
filepath=Linux
filei=build/GemRB-*.AppImage
fileo=GemRB-$(date +%F)-${GITHUB_REF##*/}-${GITHUB_SHA:0:10}-x86_64.AppImage
filepath="$filepath/$fileo"
scp $filei \
[email protected]:/home/frs/project/gemrb/Buildbot\\\ Binaries/$filepath