forked from OpenRCT2/OpenRCT2
-
Notifications
You must be signed in to change notification settings - Fork 0
285 lines (285 loc) · 9.78 KB
/
ci.yml
File metadata and controls
285 lines (285 loc) · 9.78 KB
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: CI
on: [push, pull_request]
env:
OPENRCT2_BUILD_SERVER: GitHub
OPENRCT2_ORG_TOKEN: ${{ secrets.OPENRCT2_ORG_TOKEN }}
BACKTRACE_IO_TOKEN: ${{ secrets.BACKTRACE_IO_TOKEN }}
OPENRCT2_VERSION: 0.3.0
jobs:
lint-commit:
name: Lint Commit Message
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Lint Commit Messages
uses: wagoid/commitlint-github-action@v1
with:
configFile: .commitlint.json
check-code-formatting:
name: Check code formatting
runs-on: ubuntu-latest
container:
image: openrct2/openrct2-build:0.2.4-format
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run clang-format
run: scripts/check-code-formatting
windows:
name: Windows
runs-on: windows-latest
needs: [check-code-formatting]
strategy:
fail-fast: false
matrix:
platform: [win32, x64]
env:
CONFIGURATION: Release
PLATFORM: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build OpenRCT2
shell: bash
run: . scripts/setenv && build
- name: Build artifacts
shell: bash
run: |
. scripts/setenv -q
build-portable
build-symbols
build-installer -i
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v2-preview
with:
name: "OpenRCT2-Windows-${{ matrix.platform }}"
path: artifacts/*
- name: Run Tests
shell: bash
run: . scripts/setenv -q && run-tests
- name: Upload artifacts (openrct2.org)
shell: bash
run: |
. scripts/setenv -q
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
upload-build artifacts/openrct2-portable-*.zip "windows-portable-$PLATFORM" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
upload-build artifacts/openrct2-installer-*.exe "windows-installer-$PLATFORM" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
upload-build artifacts/openrct2-symbols-*.zip "windows-symbols-$PLATFORM" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
upload-backtrace-symbols artifacts/openrct2-symbols-*.zip
else
echo 'Not going to push build'
fi
windows-mingw:
name: Windows (win32) using mingw
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.2.4-mingw
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build OpenRCT2
run: |
sudo su
mkdir bin && cd bin
cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt -DCMAKE_BUILD_TYPE=MinSizeRel -DDISABLE_IPO=on -DFORCE32=on -DBUILD_SHARED_LIBS=ON -DENABLE_SCRIPTING=OFF
ninja -k0
macos:
name: macOS
runs-on: macos-latest
needs: [check-code-formatting]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build OpenRCT2
run: |
. scripts/setenv
xcodebuild
mkdir -p artifacts
mv build/Release/OpenRCT2.app artifacts
echo -e "\033[0;36mCompressing OpenRCT2.app...\033[0m"
cd artifacts
zip -rq openrct2-macos.zip OpenRCT2.app
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v2-preview
with:
name: "OpenRCT2-macOS"
path: artifacts/openrct2-macos.zip
- name: Upload artifacts (openrct2.org)
run: |
. scripts/setenv
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
upload-build artifacts/openrct2-macos.zip macos $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
else
echo 'Not going to push build'
fi
linux-portable:
name: Linux (x64, portable)
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.2.4-bionic
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Get pre-reqs
shell: bash
run: . scripts/setenv && get-discord-rpc
- name: Build OpenRCT2
shell: bash
run: . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=ON -DPORTABLE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz"
- name: Build artifacts
shell: bash
run: . scripts/setenv -q && build-portable artifacts/OpenRCT2-Linux-x86_64.tar.gz bin/install/usr
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v1
with:
name: "OpenRCT2-Linux-x86_64"
path: artifacts
- name: Run Tests
shell: bash
run: . scripts/setenv -q && run-tests
- name: Upload artifacts (openrct2.org)
shell: bash
run: |
. scripts/setenv -q
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
upload-build artifacts/OpenRCT2-Linux-x86_64.tar.gz linux-x86_64 $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
else
echo 'Not going to push build'
fi
linux-portable-32:
name: Linux (i686, portable)
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.2.4-bionic32
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Get pre-reqs
shell: bash
run: . scripts/setenv && get-discord-rpc
- name: Build OpenRCT2
shell: bash
env:
TESTPAINT: true
run: . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=ON -DPORTABLE=ON -DFORCE32=ON -DENABLE_SCRIPTING=OFF -DCMAKE_CXX_FLAGS="-m32 -gz"
- name: Build artifacts
shell: bash
run: . scripts/setenv -q && build-portable artifacts/OpenRCT2-Linux-i686.tar.gz bin/install/usr
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v1
with:
name: "OpenRCT2-Linux-i686"
path: artifacts
- name: Run Tests
shell: bash
run: . scripts/setenv -q && run-tests
- name: Run testpaint
shell: bash
run: . scripts/setenv -q && run-testpaint
- name: Upload artifacts (openrct2.org)
shell: bash
run: |
. scripts/setenv -q
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
upload-build artifacts/OpenRCT2-Linux-i686.tar.gz linux-i686 $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
else
echo 'Not going to push build'
fi
linux-appimage:
name: Linux (x64, AppImage)
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.2.4-bionic
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Get pre-reqs
shell: bash
run: . scripts/setenv -q && get-discord-rpc
- name: Build OpenRCT2
shell: bash
run: . scripts/setenv -q && build -DCMAKE_BUILD_TYPE=Release -DAPPIMAGE=ON
- name: Build AppImage
shell: bash
run: . scripts/setenv -q && build-appimage
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v1
with:
name: OpenRCT2-AppImage
path: artifacts
linux-docker:
name: Linux (docker)
needs: [check-code-formatting]
if: github.repository == 'OpenRCT2/OpenRCT2'
runs-on: ubuntu-latest
steps:
- name: Build image
run: |
git clone --depth 1 https://github.com/OpenRCT2/openrct2-docker .
docker build -t openrct2/openrct2-cli:develop develop/cli
- name: Push image
env:
OPENRCT2_DOCKER_USER: ${{ secrets.OPENRCT2_DOCKER_USER }}
OPENRCT2_DOCKER_PASS: ${{ secrets.OPENRCT2_DOCKER_PASS }}
run: |
OPENRCT2_BRANCH=$(echo "$GITHUB_REF" | sed 's/refs\/heads\///')
echo "Current branch is $OPENRCT2_BRANCH"
if [ "$OPENRCT2_BRANCH" = 'develop' ]; then
docker login -u "$OPENRCT2_DOCKER_USER" -p "$OPENRCT2_DOCKER_PASS"
docker push openrct2/openrct2-cli:develop
else
echo 'Image not pushed'
fi
linux-clang:
name: Linux (Debug, [http, network, OpenGL] disabled) using clang
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.2.4-bionic
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build OpenRCT2
shell: bash
run: . scripts/setenv && build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON -DDISABLE_OPENGL=ON
android:
name: Android
runs-on: ubuntu-latest
needs: [check-code-formatting]
container:
image: openrct2/openrct2-build:0.2.4-android
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build OpenRCT2
shell: bash
run: |
. scripts/setenv
pushd src/openrct2-android
./gradlew app:assemblePR
popd
mkdir -p artifacts
mv src/openrct2-android/app/build/outputs/apk/arm/pr/app-arm-pr.apk artifacts/openrct2-arm.apk
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v1
with:
name: "OpenRCT2-Android"
path: artifacts
- name: Upload artifacts (openrct2.org)
shell: bash
run: |
. scripts/setenv -q
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
upload-build artifacts/openrct2-arm.apk android-arm $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
else
echo 'Not going to push build'
fi