Skip to content

Commit 7995f7a

Browse files
Erik Bylundkirre-bylund
authored andcommitted
Move functional tests into same workflow as smoke tests
1 parent 5addfd6 commit 7995f7a

File tree

2 files changed

+55
-70
lines changed

2 files changed

+55
-70
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

.github/workflows/smoke-test-and-package.yml renamed to .github/workflows/run-tests-and-package.yml

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Smoke Tests and Package SDK
2-
run-name: Smoke Tests and Package SDK on commit ${{ github.sha }}
1+
name: Run Tests and Package SDK
2+
run-name: Run Tests and Package SDK on commit ${{ github.sha }}
33
on:
44
pull_request:
55
branches: # Made towards the following
@@ -16,6 +16,58 @@ on:
1616
workflow_dispatch: {}
1717

1818
jobs:
19+
functional-tests:
20+
name: Functional tests with config ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }}
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 20
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
testMode:
27+
- playmode
28+
unityVersion:
29+
- 2019.4.40f1
30+
- 2020.3.48f1
31+
- 2021.3.29f1
32+
- 2022.3.7f1
33+
jsonLibrary:
34+
- zerodep
35+
- newtonsoft
36+
steps:
37+
- name: Checkout this repository
38+
uses: actions/checkout@v2
39+
- name: Checkout test repository
40+
uses: actions/checkout@v2
41+
with:
42+
repository: LootLocker/unity-sdk-tests
43+
path: ./tests~ # Unity ignores folders with ~ from inclusion
44+
- name: Set SDK path in test repo
45+
run: sudo chmod 777 ./tests~/switchLootLockerDependency.sh && ./tests~/switchLootLockerDependency.sh "./tests~/" "file:../../"
46+
- name: Cache Libraries
47+
uses: actions/cache@v2
48+
with:
49+
path: tests~/Library
50+
key: Library-${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }}
51+
restore-keys: Library-
52+
- name: Configure LootLocker to use Newtonsoft JSON
53+
if: ${{ matrix.jsonLibrary == 'newtonsoft' }}
54+
run: |
55+
sed -i 's/NO_LOOTLOCKER_USE_NEWTONSOFTJSON/LOOTLOCKER_USE_NEWTONSOFTJSON/' tests~/ProjectSettings/ProjectSettings.asset
56+
- name: Run tests ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }}
57+
uses: game-ci/unity-test-runner@v2
58+
id: tests
59+
env:
60+
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
61+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
62+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
63+
with:
64+
testMode: ${{ matrix.testMode }}
65+
checkName: ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }} Test Results
66+
artifactsPath: ${{ matrix.unityVersion }}-${{ matrix.testMode }}-${{ matrix.jsonLibrary }}-artifacts
67+
projectPath: tests~/
68+
unityVersion: ${{ matrix.unityVersion }}
69+
githubToken: ${{ secrets.GITHUB_TOKEN }}
70+
customParameters: -apikey ${{ secrets.LOOTLOCKER_API_KEY }} -domainkey ${{ secrets.LOOTLOCKER_DOMAIN_KEY }}
1971
editor-smoke-test:
2072
name: Test SDK in Editor
2173
runs-on: [ubuntu-latest]
@@ -500,7 +552,7 @@ jobs:
500552
#runs-on: [k8s]
501553
#container:
502554
# image: ubuntu-latest
503-
needs: [test-samples, validate-sdk]
555+
needs: [test-samples, validate-sdk, functional-tests]
504556
timeout-minutes: 5
505557
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')
506558
env:

0 commit comments

Comments
 (0)