forked from enigma-dev/enigma-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
332 lines (297 loc) · 11.8 KB
/
azure-pipelines.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
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
resources:
repositories:
- repository: radialgm
type: github
name: enigma-dev/RadialGM
endpoint: github.com_EnigmaBot
# ref: refs/pull/138/merge # Use this for testing a co-dependent rgm pr but comment this before merging
pr: # Trigger a build on every PR.
branches:
include:
- '*' # Must quote since "*" is a YAML reserved character
variables:
- template: azure-vars.yml@radialgm
- group: Test Harness Auth
jobs:
- template: azure-jobs.yml@radialgm
parameters:
repo: radialgm
enigmaref: $(Build.SourceBranch)
- job: TestHarness
displayName: 'Test Harness'
variables:
TEST_HARNESS: "true"
TRAVIS_OS_NAME: "linux"
TRAVIS: "true"
TRAVIS_PULL_REQUEST: $(System.PullRequest.PullRequestNumber)
TRAVIS_PULL_REQUEST_SHA: $(Build.SourceVersion)
pool:
vmImage: 'ubuntu-20.04'
timeoutInMinutes: 360
steps:
- checkout: self
persistCredentials: true
- script: |
sudo dpkg --add-architecture i386
./CI/install_emake_deps.sh
./CI/split_jobs.sh install
sudo cp ./CI/asound.conf /etc/asound.conf
displayName: Install Dependencies
- script: |
make -j4
make -j4 emake
displayName: Build emake
- script: |
make emake-tests
./emake-tests
displayName: Test emake
- script: |
./CI/build_and_run_game.sh
env:
_IMGUR_CLIENT_ID: $(imgur_client_id)
_BOT_COMMENT_TOKEN: $(bot_comment_token)
_BOT_PUSH_ON_GREEN_TOKEN: $(bot_push_on_green_token)
_CODECOV_UPLOAD_TOKEN: $(codecov_upload_token)
displayName: Run Test Harness
- job: Windows
displayName: 'Windows'
pool:
vmImage: 'windows-latest'
timeoutInMinutes: 360
variables:
COMPILER: gcc
OUTPUT: /tmp/test.exe
steps:
- checkout: self
persistCredentials: true
path: enigma-dev
- script: git clone --depth 1 https://github.com/enigma-dev/enigma-android.git android
displayName: 'Clone Android Repo'
- script: |
(robocopy $(Build.SourcesDirectory) C:\enigma-dev /COPYALL /E) ^& IF %ERRORLEVEL% LEQ 1 exit 0
displayName: 'Stage ENIGMA'
- script: |
C:\enigma-dev\enigma_bootstrap.bat
displayName: 'Bootstrap ENIGMA Install'
- script: |
C:\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -here -lc "export PLATFORM=%PLATFORM%; ./ci-build.sh && ./share_logs.sh"
displayName: 'Run Mode'
workingDirectory: C:\enigma-dev
env:
MODE: Run
PLATFORM: Win32
GRAPHICS: Direct3D9
AUDIO: None
COLLISION: None
NETWORK: None
WIDGETS: None
EXTENSIONS: "None"
- script: |
C:\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -here -lc "export PLATFORM=%PLATFORM%; ./ci-build.sh && ./share_logs.sh"
displayName: 'Compile Mode'
workingDirectory: C:\enigma-dev
env:
MODE: Compile
PLATFORM: Win32
GRAPHICS: Direct3D9
AUDIO: None
COLLISION: None
NETWORK: None
WIDGETS: None
EXTENSIONS: "None"
- script: |
C:\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -here -lc "export PLATFORM=%PLATFORM%; ./ci-build.sh && ./share_logs.sh"
displayName: 'Windows APIs & Extensions'
workingDirectory: C:\enigma-dev
env:
GRAPHICS: Direct3D11
AUDIO: DirectSound
WIDGETS: Win32
EXTENSIONS: "DirectShow,WindowsTouch,XInput,MediaControlInterface,FileDropper,IniFilesystem,ExternalFuncs"
PLATFORM: Win32
MODE: Debug
COLLISION: None
NETWORK: None
- script: |
C:\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -here -lc "export PLATFORM=%PLATFORM%; ./ci-build.sh && ./share_logs.sh"
displayName: 'OpenGL1 & OpenAL'
workingDirectory: C:\enigma-dev
env:
GRAPHICS: OpenGL1
AUDIO: OpenAL
PLATFORM: Win32
MODE: Debug
COLLISION: None
NETWORK: None
WIDGETS: None
EXTENSIONS: "None"
- script: |
C:\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -here -lc "export PLATFORM=SDL; ./ci-build.sh && ./share_logs.sh"
displayName: 'OpenGLES & SDL'
workingDirectory: C:\enigma-dev
env:
GRAPHICS: OpenGLES3
PLATFORM: Win32
MODE: Debug
AUDIO: None
COLLISION: None
NETWORK: None
WIDGETS: None
EXTENSIONS: "None"
- script: |
cmd /c C:\msys64\msys2_shell.cmd -defterm -mingw64 -no-start -here -lc "rm -rf /tmp/*"
"%TMP%\nsis-binary-7208-3\Bin\makensis" /V4 "C:/enigma-dev/enigma.nsi"
displayName: 'Build Installer'
- task: PublishBuildArtifacts@1
displayName: 'Push Build Artifacts'
inputs:
pathtoPublish: 'C:\Windows\Temp\ENIGMA-installer.exe'
artifactName: ENIGMA-installer
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
- task: GithubRelease@0
displayName: 'Publish GitHub Release'
inputs:
gitHubConnection: github.com_EnigmaBot
repositoryName: enigma-dev/enigma-dev
action: create
tagSource: manual
tag: 'ENIGMA-$(Build.SourceVersion)'
isDraft: false
isPreRelease: false
assetUploadMode: replace
assets: |
C:\Windows\Temp\ENIGMA-installer.exe
- job: CrossCompile
displayName: 'Cross Compile'
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
persistCredentials: true
path: enigma-dev
- bash: |
set -e
cd $(Build.BinariesDirectory)
ARCH_URL=`curl -s https://mirrors.acm.wpi.edu/archlinux/iso/latest/ | egrep -o 'archlinux-bootstrap-([0-9._]+)-x86_64.tar.gz' | head -n1`
echo https://mirrors.acm.wpi.edu/archlinux/iso/latest/$ARCH_URL
curl https://mirrors.acm.wpi.edu/archlinux/iso/latest/$ARCH_URL -o arch.tar.gz
sudo tar xzf arch.tar.gz
sudo mount --bind ./root.x86_64/ ./root.x86_64/
sudo cp -R $(Agent.BuildDirectory)/enigma-dev ./root.x86_64/
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
echo 'Server = https://mirrors.kernel.org/archlinux/\$repo/os/\$arch' >> /etc/pacman.d/mirrorlist
pacman-key --init
pacman-key --populate archlinux
pacman -Syu --noconfirm base base-devel sudo go git protobuf grpc yaml-cpp pugixml rapidjson boost xorg-server-xvfb
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
mkdir -p /home/aur/packages/
useradd -G wheel aur
chown -R aur:aur /home/aur
EOF
displayName: 'Bootstrap Archlinux'
- bash: |
set -e
cd $(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
cd /home/aur/packages
sudo -u aur git clone https://aur.archlinux.org/yay-git.git
cd yay-git
sudo -u aur makepkg
pacman -U --noconfirm yay-*.tar.*
sudo -u aur yay -S --noconfirm --builddir /home/aur/packages lcov mingw-w64-gcc mingw-w64-binutils mingw-w64-crt mingw-w64-headers mingw-w64-winpthreads
EOF
displayName: 'Build & Install AUR Packages'
- bash: |
set -e
cd $(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
cp enigma-dev/CI/asound.conf /etc/asound.conf
echo "[multilib]
Include = /etc/pacman.d/mirrorlist
[mingw32]
Server = http://mirrors.enigma-dev.org/mingw/mingw32/
[mingw64]
Server = http://mirrors.enigma-dev.org/mingw/mingw64/
[ucrt64]
Server = http://mirrors.enigma-dev.org/mingw/ucrt64/
[clang64]
Server = http://mirrors.enigma-dev.org/mingw/clang64/
[msys]
Server = http://mirrors.enigma-dev.org/msys/x86_64/" >> /etc/pacman.conf
curl https://raw.githubusercontent.com/msys2/MSYS2-keyring/master/msys2.gpg -o /usr/share/pacman/keyrings/msys2.gpg
curl https://raw.githubusercontent.com/msys2/MSYS2-keyring/master/msys2-trusted -o /usr/share/pacman/keyrings/msys2-trusted
pacman-key --populate msys2
pacman -Sy --noconfirm wine pulseaudio lib32-libpulse mingw-w64-x86_64-openal mingw-w64-x86_64-dumb mingw-w64-x86_64-libvorbis mingw-w64-x86_64-libogg mingw-w64-x86_64-flac mingw-w64-x86_64-mpg123 mingw-w64-x86_64-libsndfile mingw-w64-x86_64-zlib mingw-w64-x86_64-libffi mingw-w64-x86_64-box2d mingw-w64-x86_64-glew mingw-w64-x86_64-glm mingw-w64-x86_64-alure mingw-w64-x86_64-SDL2 mingw-w64-x86_64-pkg-config
pacman -S --noconfirm mingw-w64-i686-openal mingw-w64-i686-dumb mingw-w64-i686-libvorbis mingw-w64-i686-libogg mingw-w64-i686-flac mingw-w64-i686-mpg123 mingw-w64-i686-libsndfile mingw-w64-i686-zlib mingw-w64-i686-libffi mingw-w64-i686-box2d mingw-w64-i686-glew mingw-w64-i686-glm mingw-w64-i686-alure mingw-w64-i686-SDL2 mingw-w64-i686-pkg-config
EOF
displayName: 'Install MinGW Engine Dependencies'
- bash: |
set -e
cd $(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
cd enigma-dev
make emake
EOF
displayName: 'Build emake'
- bash: |
set -e
cd $(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
cd enigma-dev
./emake -x MinGW32 -p Win32 -w Win32 -a DirectSound -e DirectShow,WindowsTouch,XInput,MediaControlInterface,FileDropper,ExternalFuncs -o /tmp/test32.exe CommandLine/testing/SimpleTests/clean_exit.sog/
pulseaudio --start --verbose
LIBGL_ALWAYS_SOFTWARE=1 WINEDLLOVERRIDES="mscoree,mshtml=" WINEPREFIX=/tmp/.wine32 WINEARCH=win32 xvfb-run wine /tmp/test32.exe
EOF
displayName: 'Engine MinGW32'
- bash: |
set -e
cd $(Build.BinariesDirectory)
cat << EOF | sudo ./root.x86_64/bin/arch-chroot ./root.x86_64/
set -e
cd enigma-dev
./emake -x MinGW64 -p Win32 -w Win32 -a DirectSound -e DirectShow,WindowsTouch,XInput,MediaControlInterface,FileDropper,ExternalFuncs -o /tmp/test64.exe CommandLine/testing/SimpleTests/clean_exit.sog/
LIBGL_ALWAYS_SOFTWARE=1 WINEDLLOVERRIDES="mscoree,mshtml=" WINEPREFIX=/tmp/.wine64 WINEARCH=win64 xvfb-run wine /tmp/test64.exe
EOF
displayName: 'Engine MinGW64'
- job: Android
displayName: 'Android'
variables:
TEST_HARNESS: "true"
TRAVIS_OS_NAME: "linux"
TRAVIS: "true"
TRAVIS_PULL_REQUEST: $(System.PullRequest.PullRequestNumber)
TRAVIS_PULL_REQUEST_SHA: $(Build.SourceVersion)
COMPILER: Android
GRAPHICS: OpenGLES2
PLATFORM: SDL
MODE: Compile
AUDIO: SDL
COLLISION: None
NETWORK: None
WIDGETS: None
EXTENSIONS: "Alarms,Paths"
OUTPUT: /tmp/test-android-game.apk
ANDROID_API_LEVEL: 29
ANDROID_BUILD_TOOLS_VERSION: 29.0.3
ANDROID_NDK_VERSION: 23.0.7599858
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
persistCredentials: true
path: enigma-dev
- script: echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --channel=1 --install "tools" "platform-tools" "extras;google;google_play_services" "extras;google;m2repository" "extras;android;m2repository" "build-tools;29.0.3" "platforms;android-29" "ndk;23.0.7599858"
displayName: 'Install Android Dependencies'
- script: git clone --depth 1 https://github.com/enigma-dev/enigma-android.git android
displayName: 'Clone Android Repo'
- script: ./CI/install_emake_deps.sh
displayName: 'Install Emake Dependencies'
- script: make -j4 emake
displayName: 'Build Emake'
- script: ./ci-build.sh
displayName: 'Build Game'