-
-
Notifications
You must be signed in to change notification settings - Fork 23
130 lines (115 loc) · 3.79 KB
/
Copy pathunity-test.yml
File metadata and controls
130 lines (115 loc) · 3.79 KB
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
# Secrets
# UNITY_LICENSE:
name: unity-test
on:
push:
branches:
- develop
tags:
- "!*"
pull_request:
types:
- opened
- synchronize
schedule:
- cron: "0 0 * * 0" # weekly
workflow_dispatch:
env:
MINIMUM_UNITY_VERSION: 2018.3
EXCLUDE_UNITY_VERSION: "2018.3|2019.2"
jobs:
setup:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.setup.outputs.versions }}
steps:
- id: setup
run: |
VERSIONS=`npx unity-changeset list --versions --all --latest-patch --min ${{ env.MINIMUM_UNITY_VERSION }} --json \
| jq -c '[ .[] | select(test("${{ env.EXCLUDE_UNITY_VERSION }}")==false) ]'`
echo "::set-output name=versions::$VERSIONS"
test:
runs-on: ubuntu-latest
needs: setup
strategy:
max-parallel: 4
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.versions) }}
steps:
# Checkout sandbox project
- uses: actions/checkout@v2
with:
ref: sandbox
submodules: true
fetch-depth: 0
# Update package submodule
- name: "Update package submodule"
working-directory: Packages/dev
run: git checkout ${{ github.sha }}
- name: "Setup"
id: setup
run: |
# Remove CSC_SETTINGS_DEVELOP symbol
sed -i -e 's/CSC_SETTINGS_DEVELOP//' ProjectSettings/ProjectSettings.asset
# IL2CPP Support
echo '${{ matrix.version }}' | grep -q '\(2018\|2019.1\|2019.2\|2019.3\|2020.1\)' \
&& echo "module=" >> $GITHUB_ENV | tee \
|| echo "module=-linux-il2cpp" >> $GITHUB_ENV | tee
# Cache
# - uses: actions/cache@v2
# with:
# path: Library
# key: Library-${{ matrix.version }}-${{ github.sha }}
# restore-keys: |
# Library-${{ matrix.version }}-
# Library-
# Run tests
- name: Run tests
uses: game-ci/unity-test-runner@main
with:
customImage: mobsakai/unity3d:${{ matrix.version }}${{ env.module }}
customParameters: -nographics
testMode: playmode
checkName: ${{ matrix.version }} Test Results
githubToken: ${{ github.token }}
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# Build (Mono)
- name: Build (Mono)
uses: game-ci/unity-builder@main
with:
customImage: mobsakai/unity3d:${{ matrix.version }}${{ env.module }}
customParameters: -nographics /Headless /ScriptBackend Mono2x /BuildTarget StandaloneLinux64
targetPlatform: StandaloneLinux64
buildMethod: UnitTestBuilder.BuildUnitTest
allowDirtyBuild: true
versioning: Custom
version: 1.0.0
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# Execute unit test player (Mono)
- name: "Execute unit test player (Mono)"
run: |
tree ./bin
./bin/UnitTest/StandaloneLinux64_Mono2x/test
# Build (IL2CPP)
- name: Build (IL2CPP)
uses: game-ci/unity-builder@main
if: env.module == '-linux-il2cpp'
with:
customImage: mobsakai/unity3d:${{ matrix.version }}${{ env.module }}
customParameters: -nographics /Headless /ScriptBackend IL2CPP /BuildTarget StandaloneLinux64
targetPlatform: StandaloneLinux64
buildMethod: UnitTestBuilder.BuildUnitTest
allowDirtyBuild: true
versioning: Custom
version: 1.0.0
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# Execute unit test player (IL2CPP)
- name: "Execute unit test player (IL2CPP)"
if: env.module == '-linux-il2cpp'
run: |
tree ./bin
./bin/UnitTest/StandaloneLinux64_IL2CPP/test