-
Notifications
You must be signed in to change notification settings - Fork 7
119 lines (118 loc) · 4.99 KB
/
editor-smoke-test.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
name: Editor Smoke Test
run-name: editor-smoke-test
on:
pull_request:
branches: # Made towards the following
- main
- dev*
- ci/dev
types: # Only on the following activity
- opened
- synchronize # Changes to the branch like new commits, ammends, etc.
- reopened
- unlocked
push:
branches: # Made towards the following
- main
- dev
- ci/dev
tags:
- v**
workflow_dispatch: {}
jobs:
editor-smoke-test:
name: Editor smoke test
runs-on: [ubuntu-latest]
if: ${{ false }}
#runs-on: [k8s]
#container:
# image: ubuntu-latest
env:
LL_USE_STAGE: false
strategy:
fail-fast: false
matrix:
testMode:
- playmode
unityVersion:
- 2019.4.40f1
- 2020.3.48f1
- 2021.3.32f1
- 2022.3.14f1
- 2023.2.1f1
steps:
- name: Setup commandline dependencies (if on self-hosted runner)
if: ${{ env.LL_USE_STAGE == 'true' }}
run: |
apt update
apt-get install -y git
git config --global --add safe.directory unity-sdk
git config --global --add safe.directory unity-sdk-smoketest-project
apt-get install -y jq
apt-get install -y sed
apt-get install -y docker
apt-get install -y curl
apt-get update
apt-get install ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- name: Select stage keys
if: ${{ env.LL_USE_STAGE == 'true' }}
run: |
echo "JOB_API_KEY=${{ SECRETS.SMOKE_TEST_LL_API_KEY }}" >> $GITHUB_ENV
echo "JOB_DOMAIN_KEY=${{ SECRETS.SMOKE_TEST_LL_DOMAIN_KEY }}" >> $GITHUB_ENV
- name: Select prod keys
if: ${{ env.LL_USE_STAGE == 'false' }}
run: |
echo "JOB_API_KEY=${{ SECRETS.LOOTLOCKER_API_KEY }}" >> $GITHUB_ENV
echo "JOB_DOMAIN_KEY=${{ SECRETS.LOOTLOCKER_DOMAIN_KEY }}" >> $GITHUB_ENV
- name: Checkout unity-sdk repository
uses: actions/checkout@v3
with:
path: unity-sdk
- name: Checkout unity-sdk-smoketest-project repository
uses: actions/checkout@v3
with:
repository: lootlocker/unity-sdk-smoketest-project
path: unity-sdk-smoketest-project
token: ${{ SECRETS.LL_PERSONAL_ACCESS_TOKEN }}
- name: Set package reference to local unity-sdk
run: |
echo "Updating unity-sdk-smoketest-project/Packages/manifest.json to use lootlocker sdk at relative path (from manifest) ../../unity-sdk"
jq ".\"dependencies\".\"com.lootlocker.lootlockersdk\"=\"file:../../unity-sdk\"" "unity-sdk-smoketest-project/Packages/manifest.json" > "unity-sdk-smoketest-project/Packages/tempmanifest.json"
rm "unity-sdk-smoketest-project/Packages/manifest.json"
mv "unity-sdk-smoketest-project/Packages/tempmanifest.json" "unity-sdk-smoketest-project/Packages/manifest.json"
- name: Configure LootLocker to take keys by commandline
run: |
sed -i 's/NO_LOOTLOCKER_COMMANDLINE_SETTINGS/LOOTLOCKER_COMMANDLINE_SETTINGS/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset
- name: Configure LootLocker to target stage environment
if: ${{ env.LL_USE_STAGE == 'true' }}
run: |
sed -i 's/NO_LOOTLOCKER_TARGET_STAGE_ENV/LOOTLOCKER_TARGET_STAGE_ENV/' unity-sdk-smoketest-project/ProjectSettings/ProjectSettings.asset
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.unityVersion }}-${{ matrix.testMode }}
restore-keys: Library-
- name: Run Smoke Tests ${{ matrix.unityVersion }}-${{ matrix.testMode }}
id: editor-smoke-tests-gameci
uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ SECRETS.UNITY_LICENSE }}
UNITY_EMAIL: ${{ SECRETS.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ SECRETS.UNITY_PASSWORD }}
with:
testMode: ${{ matrix.testMode }}
checkName: ${{ matrix.unityVersion }}-${{ matrix.testMode }} Test Results
artifactsPath: editor-smoke-tests-gameci-${{ matrix.unityVersion }}-${{ matrix.testMode }}-artifacts
projectPath: unity-sdk-smoketest-project
unityVersion: ${{ matrix.unityVersion }}
githubToken: ${{ SECRETS.GITHUB_TOKEN }}
customParameters: -apikey ${{ ENV.JOB_API_KEY }} -domainkey ${{ ENV.JOB_DOMAIN_KEY }}