-
-
Notifications
You must be signed in to change notification settings - Fork 39
280 lines (244 loc) · 10.6 KB
/
ci.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
name: package-plugin-workflow
on: push
jobs:
android-sdk:
uses: ./.github/workflows/sdk-build.yml
with:
target: Android
runsOn: ubuntu-latest
ios-sdk:
uses: ./.github/workflows/sdk-download.yml
with:
target: IOS
runsOn: ubuntu-latest
macos-sdk:
uses: ./.github/workflows/sdk-download.yml
with:
target: Mac
runsOn: ubuntu-latest
linux-sdk:
uses: ./.github/workflows/sdk-build.yml
with:
target: Linux
# Build for an older GLIBC so that it can run with the old GLIBC included in EpicGames' Unreal docker images.
# See discussion in https://github.com/getsentry/sentry-unreal/pull/173
runsOn: ubuntu-20.04
linux-arm64-sdk:
uses: ./.github/workflows/sdk-build.yml
with:
target: LinuxArm64
runsOn: ubuntu-latest-4-cores-arm64
container: arm64v8/ubuntu:20.04
windows-crashpad-sdk:
uses: ./.github/workflows/sdk-build.yml
with:
target: Win64-Crashpad
runsOn: windows-2019
windows-breakpad-sdk:
uses: ./.github/workflows/sdk-build.yml
with:
target: Win64-Breakpad
runsOn: windows-2019
build:
needs: [android-sdk, ios-sdk, macos-sdk, linux-sdk, linux-arm64-sdk, windows-crashpad-sdk, windows-breakpad-sdk]
name: Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download CLI
shell: pwsh
run: ./scripts/download-cli.ps1
- uses: actions/download-artifact@v4
with:
name: Android-sdk
path: plugin-dev/Source/ThirdParty/Android
- uses: actions/download-artifact@v4
with:
name: Android-libraries
path: modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib
- uses: actions/download-artifact@v4
with:
name: IOS-sdk
path: plugin-dev/Source/ThirdParty/IOS
- uses: actions/download-artifact@v4
with:
name: Mac-sdk
path: plugin-dev/Source/ThirdParty/Mac
- uses: actions/download-artifact@v4
with:
name: Linux-sdk
path: plugin-dev/Source/ThirdParty/Linux
- uses: actions/download-artifact@v4
with:
name: LinuxArm64-sdk
path: plugin-dev/Source/ThirdParty/LinuxArm64
- uses: actions/download-artifact@v4
with:
name: Win64-Crashpad-sdk
path: plugin-dev/Source/ThirdParty/Win64/Crashpad
- uses: actions/download-artifact@v4
with:
name: Win64-Breakpad-sdk
path: plugin-dev/Source/ThirdParty/Win64/Breakpad
- name: Prepare Sentry packages for release
shell: pwsh
run: ./scripts/packaging/pack.ps1
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
# Artifact name is the commit sha. Which is what craft uses to find the relevant artifact.
name: ${{ github.sha }}
if-no-files-found: error
path: |
sentry-unreal-*.zip
# Adding the native libraries so the symbol collector craft target can find/upload them
# TODO modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib/*
package-validation:
needs: [build]
name: Check snapshot
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download packages
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}
# If this step fails, you can accept the new file content by
# running the following script locally with 'accept' as an argument
# and committing the new snapshot file to your branch. i.e:
# pwsh ./scripts/test-contents.ps1 accept
- name: Verify package content against snapshot
shell: pwsh
run: ./scripts/packaging/test-contents.ps1
test:
name: Test UE ${{ matrix.unreal }}
runs-on: ubuntu-latest-4-cores
strategy:
fail-fast: false
matrix:
# Note: these versions must match scripts/packaging/engine-versions.txt
unreal: ['4.27', '5.0', '5.1', '5.2', '5.3', '5.4', '5.5']
app: ['sample']
steps:
- name: Free disk space
if: ${{ steps.exists.outputs.value == 0 }}
run: |
# time df -h
sudo time swapoff -a
sudo time rm -f /swapfile
sudo time rm -rf /usr/local/lib/android
sudo time rm -rf /usr/share/dotnet
sudo time rm -rf /usr/share/swift
sudo time rm -rf /usr/local/share/powershell
sudo time rm -rf /usr/local/.ghcup
sudo time rm -rf /usr/local/lib/node_modules
sudo time rm -rf /usr/local/share/boost
sudo time rm -rf /usr/lib/google-cloud-sdk
sudo time rm -rf /usr/lib/jvm
sudo time rm -rf /opt/pipx
sudo time rm -rf /opt/ghc
sudo time rm -rf "$AGENT_TOOLSDIRECTORY"
sudo time apt-get clean
sudo time rm -rf /var/lib/apt/lists/*
# time docker rmi $(docker image ls -aq)
# time du --max-depth=3 --threshold=100M -h /usr /opt /var 2>/dev/null | sort -hr
df -h
- name: Start Docker container
run: |
echo ${{ secrets.DOCKER_TOKEN }} | docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
# We start the container with the user ID of the parent GH action user to avoid permission issues on volume.
# For UE 5.4 we have to enable ipv6 to fix container startup issues. See https://github.com/adamrehn/ue4-docker/issues/357
uid=$(id -u) # the GH action user ID
gid=1000 # the ue4 group in the docker container
user='gh'
set -x
docker network create --ipv6 --subnet 2001:0DB8::/112 ip6net
docker run -td \
--name unreal \
--volume ${{ github.workspace }}:/workspace \
--workdir /workspace \
--user $uid:$gid \
--env HOME="/home/$user" \
--env PATH="/home/$user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
--network ip6net -p 80:80 \
ghcr.io/epicgames/unreal-engine:dev-slim-${{ matrix.unreal }}.1
docker logout ghcr.io
# Add the user so it has a home directory (needed to run tests later on)
docker exec --user root unreal useradd -u $uid -g $gid --create-home $user
# Ensure CA certs are in the right directory (needed for running tests)
docker exec --user root unreal bash -c "
mkdir -p /etc/pki/tls/certs ;
cp /etc/ssl/certs/ca-certificates.crt /etc/pki/tls/certs/ca-bundle.crt "
# Chown some paths to the GH user to make UE5 work properly. We can't just chown the whole UnrealEngine or
# docker would implicitly have to copy it to the container and we would run out of space on the GH runner.
- name: Chown Docker container paths
run: |
uid=$(id -u) # the GH action user ID
docker exec --user root unreal bash -c "
chown -R $uid /home/ue4/UnrealEngine/Engine/Binaries/ThirdParty/Mono/Linux ;
chown -R $uid /home/ue4/UnrealEngine/Engine/${{ matrix.unreal == '4.27' && 'Programs/UnrealPak/Saved' || 'Binaries/ThirdParty/DotNet' }} ;
chown -R $uid /home/ue4/UnrealEngine/Engine/Binaries/ThirdParty/USD/UsdResources/Linux ;
mkdir -p /home/ue4/UnrealEngine/Epic/UnrealEngine && chown -R $uid /home/ue4/UnrealEngine/Epic ;
mkdir -p /home/ue4/UnrealEngine/Engine/Source/Epic/UnrealEngine && chown -R $uid /home/ue4/UnrealEngine/Engine/Source/Epic ;
${{ matrix.unreal == '5.5' && 'chown -R $uid /home/ue4/UnrealEngine/Engine/Intermediate/Build/BuildCookRun' || '' }} "
- name: Setup C++ runtime
run: docker exec --user root unreal bash -c '
apt-get update ;
add-apt-repository ppa:ubuntu-toolchain-r/test ;
apt-get install -y libstdc++6'
- name: Download package
uses: actions/download-artifact@v4
with:
name: ${{ github.sha }}
- uses: actions/checkout@v4
with:
path: checkout
- name: Extract package to ${{ matrix.app }}/Plugins
run: unzip sentry-unreal-*-engine${{ matrix.unreal }}-github.zip -d checkout/${{ matrix.app }}/Plugins/sentry
- name: Set permissions for ${{ matrix.app }}
# sentry-native requires write access to sample project directory in order to initialize itself properly
run: docker exec -w /workspace/checkout unreal chmod -R +x ${{ matrix.app }}
- name: Run tests
id: run-tests
run: |
docker exec -w /workspace/checkout/${{ matrix.app }} unreal /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun \
-project=/workspace/checkout/${{ matrix.app }}/SentryPlayground.uproject \
-archivedirectory=/workspace/checkout/${{ matrix.app }}/Builds \
-platform=Linux \
-nop4 \
-cook \
-build \
-stage \
-prereqss \
-package \
-archive
docker exec -w /workspace/checkout/${{ matrix.app }} unreal bash -c "
cp -r '/home/gh/Library/Logs/Unreal Engine/LocalBuildLogs' Saved/Logs "
docker exec -w /workspace/checkout/${{ matrix.app }} unreal /home/ue4/UnrealEngine/Engine/Binaries/Linux/${{ matrix.unreal == '4.27' && 'UE4Editor' || 'UnrealEditor' }} \
/workspace/checkout/${{ matrix.app }}/SentryPlayground.uproject \
-ReportExportPath=/workspace/checkout/${{ matrix.app }}/Saved/Automation \
-ExecCmds="Automation RunTests Sentry;quit" \
-TestExit="Automation Test Queue Empty" \
-Unattended \
-NoPause \
-NoSplash \
-NullRHI
- name: Collect ${{ matrix.app }} test info
if: ${{ always() && steps.run-tests.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: UE ${{ matrix.unreal }} ${{ matrix.app }} test report
path: |
checkout/${{ matrix.app }}/Saved/Automation
- name: Collect ${{ matrix.app }} build info
if: contains(fromJson('["success", "failure"]'), steps.run-tests.outcome)
uses: actions/upload-artifact@v4
with:
name: UE ${{ matrix.unreal }} ${{ matrix.app }} build logs
path: |
checkout/${{ matrix.app }}/Saved/Logs
checkout/${{ matrix.app }}/Saved/Stats
checkout/${{ matrix.app }}/Saved/MaterialStats
checkout/${{ matrix.app }}/Saved/MaterialStatsDebug