forked from enigma-dev/enigma-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
executable file
·207 lines (185 loc) · 7.87 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
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: 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/mirrorlist* /etc/pacman.d/
cp enigma-dev/CI/asound.conf /etc/asound.conf
echo "[multilib]
Include = /etc/pacman.d/mirrorlist
[mingw32]
Include = /etc/pacman.d/mirrorlist.mingw32
[mingw64]
Include = /etc/pacman.d/mirrorlist.mingw64
[msys]
Include = /etc/pacman.d/mirrorlist.msys" >> /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: None
COLLISION: None
NETWORK: None
WIDGETS: None
EXTENSIONS: "None"
OUTPUT: /tmp/test-android-game.apk
ANDROID_API_LEVEL: 29
ANDROID_BUILD_TOOLS_VERSION: 29.0.3
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;22.0.6917172"
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'