-
-
Notifications
You must be signed in to change notification settings - Fork 39
238 lines (206 loc) · 8.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
name: package-plugin-workflow
on: push
jobs:
android-sdk:
uses: ./.github/workflows/sdk.yml
with:
target: Android
runsOn: ubuntu-latest
ios-sdk:
uses: ./.github/workflows/sdk.yml
with:
target: IOS
runsOn: macos-latest
macos-sdk:
uses: ./.github/workflows/sdk.yml
with:
target: Mac
runsOn: macos-latest
linux-sdk:
uses: ./.github/workflows/sdk.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
windows-sdk:
uses: ./.github/workflows/sdk.yml
with:
target: Win64
runsOn: windows-latest
build:
needs: [android-sdk, ios-sdk, macos-sdk, linux-sdk, windows-sdk]
name: Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download CLI
shell: pwsh
run: ./scripts/download-cli.ps1
- uses: actions/download-artifact@v2
with:
name: Android-sdk
path: plugin-dev/Source/ThirdParty/Android
- uses: actions/download-artifact@v2
with:
name: Android-libraries
path: modules/sentry-java/sentry-android-ndk/build/intermediates/merged_native_libs/release/out/lib
- uses: actions/download-artifact@v2
with:
name: IOS-sdk
path: plugin-dev/Source/ThirdParty/IOS
- uses: actions/download-artifact@v2
with:
name: Mac-sdk
path: plugin-dev/Source/ThirdParty/Mac
- uses: actions/download-artifact@v2
with:
name: Linux-sdk
path: plugin-dev/Source/ThirdParty/Linux
- uses: actions/download-artifact@v2
with:
name: Win64-sdk
path: plugin-dev/Source/ThirdParty/Win64
- name: Prepare Sentry packages for release
shell: pwsh
run: ./scripts/packaging/pack.ps1
- name: Upload release artifacts
uses: actions/[email protected]
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@v3
- name: Download packages
uses: actions/download-artifact@v2
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
strategy:
fail-fast: false
matrix:
# Note: these versions must match scripts/packaging/engine-versions.txt
unreal: ['5.0', '5.1', '5.2']
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/.ghcup
sudo time rm -rf /usr/local/lib/node_modules
sudo time rm -rf /usr/lib/google-cloud-sdk
sudo time rm -rf /opt/pipx
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.
uid=$(id -u) # the GH action user ID
gid=1000 # the ue4 group in the docker container
user='gh'
set -x
docker run -td \
--name unreal \
--volume ${{ github.workspace }}:/workspace \
--workdir /workspace \
--user $uid:$gid \
--env PATH="/home/$user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
ghcr.io/epicgames/unreal-engine:dev-slim-${{ matrix.unreal }}
docker logout ghcr.io
# Add the user so it has a home directory (needed for the pip cache 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.
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/Binaries/ThirdParty/DotNet "
- name: Setup UE CLI
run: docker exec unreal bash -c '
pip3 install --upgrade pip ;
pip3 install -Iv ue4cli==0.0.54 ;
ue4 setroot /home/ue4/UnrealEngine '
- name: Download package
uses: vaind/download-artifact@989a39a417730897d098ab11c34e49ac4e13ed70
with:
name: ${{ github.sha }}
wait-timeout: 600
- uses: actions/checkout@v3
with:
path: checkout
- name: Extract package to ${{ matrix.app }}/Plugins
run: unzip sentry-unreal-*-engine${{ matrix.unreal }}.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 ue4 build
docker exec -w /workspace/checkout/${{ matrix.app }} unreal ue4 editor \
/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/[email protected]
with:
name: UE ${{ matrix.unreal }} ${{ matrix.app }} test report
path: |
checkout/${{ matrix.app }}/Saved/Automation
- name: Build & package ${{ matrix.app }}
# Unreal 5.0 takes ~1 hour to build+package the app so only do it on v4.27
if: ${{ matrix.unreal == '4.27'}}
id: package-app
run: |
docker exec -w /workspace/checkout/${{ matrix.app }} unreal ue4 package
docker exec -w /workspace/checkout/${{ matrix.app }} unreal cp -r '/home/gh/Library/Logs/Unreal Engine/LocalBuildLogs' Saved/Logs
- name: Collect ${{ matrix.app }} build info
if: contains(fromJson('["success", "failure"]'), steps.package-app.outcome)
uses: actions/[email protected]
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