1
- name : Do Smoke Tests and Package SDK
2
- run-name : smoke-test- and-package
1
+ name : Smoke Tests and Package SDK
2
+ run-name : Smoke Tests and Package SDK on commit ${{ github.sha }}
3
3
on :
4
4
pull_request :
5
5
branches : # Made towards the following
22
22
# runs-on: [k8s]
23
23
# container:
24
24
# image: ubuntu-latest
25
+ needs : []
25
26
env :
26
27
LL_USE_STAGE : false
27
28
strategy :
@@ -113,13 +114,13 @@ jobs:
113
114
unityVersion : ${{ matrix.unityVersion }}
114
115
githubToken : ${{ SECRETS.GITHUB_TOKEN }}
115
116
customParameters : -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }}
116
- build-smoke-test :
117
- name : Test SDK in platform builds
117
+ linux- build-smoke-test :
118
+ name : Test SDK in StandaloneLinux64 build
118
119
runs-on : [ubuntu-latest]
119
120
# runs-on: [k8s]
120
121
# container:
121
122
# image: ubuntu-latest
122
- needs : [editor-smoke-test ]
123
+ needs : []
123
124
env :
124
125
LL_USE_STAGE : false
125
126
strategy :
@@ -135,7 +136,6 @@ jobs:
135
136
- 2023.2.1f1
136
137
targetPlatform :
137
138
- StandaloneLinux64
138
- - WebGL
139
139
steps :
140
140
- name : Setup commandline dependencies (if on self-hosted runner)
141
141
if : ${{ env.LL_USE_STAGE == 'true' }}
@@ -220,27 +220,132 @@ jobs:
220
220
buildName : smokeTest
221
221
projectPath : unity-sdk-smoketest-project
222
222
customParameters : -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }}
223
- - name : Run the built game (valid for Linux)
224
- if : ${{ matrix.targetPlatform == 'StandaloneLinux64' }}
223
+ - name : Run the built game
225
224
run : |
226
225
sudo chmod 777 ./builds
227
226
sudo chmod 777 ./builds/${{ matrix.targetPlatform }}/
228
227
sudo chmod 777 ./builds/${{ matrix.targetPlatform }}/*
229
228
./builds/${{ matrix.targetPlatform }}/smokeTest -batchmode -nographics -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }}
230
229
while [ ! -f "./builds/${{ matrix.targetPlatform }}/smokeTest_Data/LLActorOutput.txt" ]; do sleep 10; ls -als ./builds/${{ matrix.targetPlatform }}/smokeTest_Data/; done
231
- - name : Test the output of the run (valid for Linux)
232
- if : ${{ matrix.targetPlatform == 'StandaloneLinux64' }}
230
+ - name : Test the output of the run
233
231
run : |
234
232
cat ./builds/${{ matrix.targetPlatform }}/smokeTest_Data/LLActorOutput.txt
235
233
grep -q "Run Succeeded" ./builds/${{ matrix.targetPlatform }}/smokeTest_Data/LLActorOutput.txt
236
234
exit $?
237
- package-sdk :
238
- name : Package SDK
235
+ webgl-build-smoke-test :
236
+ name : Test SDK in WebGL build
237
+ runs-on : [ubuntu-latest]
238
+ # runs-on: [k8s]
239
+ # container:
240
+ # image: ubuntu-latest
241
+ needs : []
242
+ if : (startsWith(github.ref, 'refs/pull') && endsWith(github.base_ref, 'main')) || startsWith(github.ref, 'refs/tags/v') || (startsWith(github.ref, 'refs/heads') && endsWith(github.ref, 'main'))
243
+ env :
244
+ LL_USE_STAGE : false
245
+ strategy :
246
+ fail-fast : false
247
+ matrix :
248
+ testMode :
249
+ - playmode
250
+ unityVersion :
251
+ - 2019.4.40f1
252
+ - 2020.3.48f1
253
+ - 2021.3.32f1
254
+ - 2022.3.14f1
255
+ - 2023.2.1f1
256
+ targetPlatform :
257
+ - WebGL
258
+ steps :
259
+ - name : Setup commandline dependencies (if on self-hosted runner)
260
+ if : ${{ env.LL_USE_STAGE == 'true' }}
261
+ run : |
262
+ apt update
263
+ apt-get install -y git
264
+ git config --global --add safe.directory unity-sdk
265
+ git config --global --add safe.directory unity-sdk-smoketest-project
266
+ apt-get install -y jq
267
+ apt-get install -y sed
268
+ apt-get install -y docker
269
+ apt-get install -y curl
270
+ apt-get update
271
+ apt-get install ca-certificates curl gnupg
272
+ install -m 0755 -d /etc/apt/keyrings
273
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
274
+ chmod a+r /etc/apt/keyrings/docker.gpg
275
+ echo \
276
+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
277
+ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
278
+ tee /etc/apt/sources.list.d/docker.list > /dev/null
279
+ apt-get update
280
+ apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
281
+ - name : Select stage keys
282
+ if : ${{ env.LL_USE_STAGE == 'true' }}
283
+ run : |
284
+ echo "JOB_API_KEY=${{ SECRETS.SMOKE_TEST_LL_API_KEY }}" >> $GITHUB_ENV
285
+ echo "JOB_DOMAIN_KEY=${{ SECRETS.SMOKE_TEST_LL_DOMAIN_KEY }}" >> $GITHUB_ENV
286
+ - name : Select prod keys
287
+ if : ${{ env.LL_USE_STAGE == 'false' }}
288
+ run : |
289
+ echo "JOB_API_KEY=${{ SECRETS.LOOTLOCKER_API_KEY }}" >> $GITHUB_ENV
290
+ echo "JOB_DOMAIN_KEY=${{ SECRETS.LOOTLOCKER_DOMAIN_KEY }}" >> $GITHUB_ENV
291
+ - name : Checkout unity-sdk repository
292
+ uses : actions/checkout@v3
293
+ with :
294
+ path : unity-sdk
295
+ - name : Checkout unity-sdk-smoketest-project repository
296
+ uses : actions/checkout@v3
297
+ with :
298
+ repository : lootlocker/unity-sdk-smoketest-project
299
+ path : unity-sdk-smoketest-project
300
+ token : ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }}
301
+ - name : Set package reference to local unity-sdk
302
+ run : |
303
+ echo "Updating unity-sdk-smoketest-project/Packages/manifest.json to use lootlocker sdk at relative path (from manifest) ../../unity-sdk"
304
+ jq ".\"dependencies\".\"com.lootlocker.lootlockersdk\"=\"file:../../unity-sdk\"" "unity-sdk-smoketest-project/Packages/manifest.json" > "unity-sdk-smoketest-project/Packages/tempmanifest.json"
305
+ rm "unity-sdk-smoketest-project/Packages/manifest.json"
306
+ mv "unity-sdk-smoketest-project/Packages/tempmanifest.json" "unity-sdk-smoketest-project/Packages/manifest.json"
307
+ - name : Configure LootLocker to take keys by commandline
308
+ run : |
309
+ sed -i 's/NO_LOOTLOCKER_COMMANDLINE_SETTINGS/LOOTLOCKER_COMMANDLINE_SETTINGS/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset
310
+ - name : Configure LootLocker to target stage environment
311
+ if : ${{ env.LL_USE_STAGE == 'true' }}
312
+ run : |
313
+ sed -i 's/NO_LOOTLOCKER_TARGET_STAGE_ENV/LOOTLOCKER_TARGET_STAGE_ENV/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset
314
+ - name : Commit all changes to allow building
315
+ run : |
316
+ git config --global user.email "fake@email.com"
317
+ git config --global user.name "Fake Name"
318
+ cd unity-sdk-smoketest-project
319
+ git add -A
320
+ git commit -m "Temporary changes for build"
321
+ - uses : actions/cache@v3
322
+ with :
323
+ path : unity-sdk-smoketest-project/Library
324
+ key : ${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project
325
+ restore-keys : |
326
+ ${{ matrix.targetPlatform }}-Library-unity-sdk-smoketest-project
327
+ Library-
328
+ - name : Run Smoke Tests ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.targetPlatform }}
329
+ id : build-smoke-tests-gameci
330
+ uses : game-ci/unity-builder@v4
331
+ env :
332
+ UNITY_LICENSE : ${{ SECRETS.UNITY_LICENSE }}
333
+ UNITY_EMAIL : ${{ SECRETS.UNITY_EMAIL }}
334
+ UNITY_PASSWORD : ${{ SECRETS.UNITY_PASSWORD }}
335
+ with :
336
+ unityVersion : ${{ matrix.unityVersion }}
337
+ targetPlatform : ${{ matrix.targetPlatform }}
338
+ buildsPath : builds
339
+ buildName : smokeTest
340
+ projectPath : unity-sdk-smoketest-project
341
+ customParameters : -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }}
342
+ test-samples-and-validate-sdk :
343
+ name : Test Samples and Validate SDK
239
344
runs-on : [ubuntu-latest]
240
345
# runs-on: [k8s]
241
346
# container:
242
347
# image: ubuntu-latest
243
- needs : [editor-smoke-test, build-smoke-test]
348
+ needs : [editor-smoke-test, linux- build-smoke-test]
244
349
env :
245
350
LL_USE_STAGE : false
246
351
strategy :
@@ -295,8 +400,8 @@ jobs:
295
400
restore-keys : |
296
401
${{ matrix.targetPlatform }}-Library-unity-sdk-packager
297
402
Library-
298
- - name : Compile and run all sample scenes ${{ matrix.unityVersion }}
299
- id : run-sdk- samples
403
+ - name : Compile and run all sample scenes ${{ matrix.unityVersion }} and validate SDK using asset store tools
404
+ id : test- samples-and-validate
300
405
uses : game-ci/unity-test-runner@v4
301
406
env :
302
407
UNITY_LICENSE : ${{ SECRETS.UNITY_LICENSE }}
@@ -305,12 +410,73 @@ jobs:
305
410
with :
306
411
testMode : editmode
307
412
checkName : Sample Scene ${{ matrix.unityVersion }} Test Results
308
- artifactsPath : run-sdk- samples-${{ matrix.unityVersion }}-artifacts
413
+ artifactsPath : test- samples-and-validate -${{ matrix.unityVersion }}-artifacts
309
414
projectPath : unity-sdk-packager
310
415
unityVersion : ${{ matrix.unityVersion }}
311
416
githubToken : ${{ SECRETS.GITHUB_TOKEN }}
417
+ package-sdk :
418
+ name : Package SDK
419
+ runs-on : [ubuntu-latest]
420
+ # runs-on: [k8s]
421
+ # container:
422
+ # image: ubuntu-latest
423
+ needs : [test-samples-and-validate-sdk]
424
+ if : (startsWith(github.ref, 'refs/pull') && endsWith(github.base_ref, 'main')) || (startsWith(github.ref, 'refs/heads') && endsWith(github.ref, 'main')) || startsWith(github.ref, 'refs/tags/v')
425
+ env :
426
+ LL_USE_STAGE : false
427
+ strategy :
428
+ fail-fast : false
429
+ matrix :
430
+ unityVersion :
431
+ - 2019.4.40f1
432
+ - 2020.3.48f1
433
+ - 2021.3.32f1
434
+ - 2022.3.14f1
435
+ - 2023.2.1f1
436
+ steps :
437
+ - name : Setup commandline dependencies (if on self-hosted runner)
438
+ if : ${{ env.LL_USE_STAGE == 'true' }}
439
+ run : |
440
+ apt update
441
+ apt-get install -y git
442
+ git config --global --add safe.directory unity-sdk
443
+ git config --global --add safe.directory unity-sdk-packager
444
+ apt-get install -y jq
445
+ apt-get install -y sed
446
+ apt-get install -y docker
447
+ apt-get install -y curl
448
+ apt-get update
449
+ apt-get install ca-certificates curl gnupg
450
+ install -m 0755 -d /etc/apt/keyrings
451
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
452
+ chmod a+r /etc/apt/keyrings/docker.gpg
453
+ echo \
454
+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
455
+ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
456
+ tee /etc/apt/sources.list.d/docker.list > /dev/null
457
+ apt-get update
458
+ apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
459
+ - name : Checkout unity-sdk repository
460
+ uses : actions/checkout@v3
461
+ with :
462
+ path : unity-sdk
463
+ - name : Checkout unity-sdk-packager-project repository
464
+ uses : actions/checkout@v3
465
+ with :
466
+ repository : lootlocker/unity-sdk-packager
467
+ path : unity-sdk-packager
468
+ token : ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }}
469
+ - name : Add LootLockerSDK as asset folder
470
+ run : |
471
+ cp -r unity-sdk unity-sdk-packager/Assets/LootLockerSDK
472
+ - uses : actions/cache@v3
473
+ with :
474
+ path : unity-sdk-packager/Library
475
+ key : ${{ matrix.targetPlatform }}-Library-unity-sdk-packager
476
+ restore-keys : |
477
+ ${{ matrix.targetPlatform }}-Library-unity-sdk-packager
478
+ Library-
312
479
- name : Package SDK for ${{ matrix.unityVersion }}
313
- if : github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
314
480
id : package-sdk-gameci
315
481
uses : game-ci/unity-test-runner@v4
316
482
env :
@@ -325,7 +491,6 @@ jobs:
325
491
unityVersion : ${{ matrix.unityVersion }}
326
492
githubToken : ${{ SECRETS.GITHUB_TOKEN }}
327
493
- name : Expose packaged SDK as artifact
328
- if : github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
329
494
uses : actions/upload-artifact@v3
330
495
with :
331
496
name : LootLockerSDK-${{ matrix.unityVersion }}.zip
0 commit comments