-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (117 loc) · 5.17 KB
/
unity-tests.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
name: Unity Tests
on:
push:
branches: master
paths:
- "**.cs"
- ".github/unity-project/**/*"
- ".github/workflows/unity-tests.yml"
pull_request:
paths:
- "**.cs"
- ".github/unity-project/**/*"
- ".github/workflows/unity-tests.yml"
jobs:
build:
name: Build and Test (${{ matrix.unity-version }}${{ matrix.import-vrcsdk && ', VRC' || '' }}${{ matrix.import-dynbone && ', DynBone' || '' }}${{ matrix.import-univrm && ', VRM' || '' }}${{ matrix.import-ma && ', MA' || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
unity-version: ['2019.4.31f1', '2022.3.6f1', '2023.2.2f1']
import-vrcsdk: [false, true]
import-ma: [false, true]
# import-dynbone: [false, true]
# import-univrm: [false, true]
import-dynbone: [false]
import-univrm: [false]
exclude:
# - unity-version: "2019.4.31f1"
# import-univrm: true
- import-vrcsdk: false
import-ma: true
- unity-version: "2023.2.2f1"
import-vrcsdk: true
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Prepare Unity Project
run: |
mv Tests~ Tests
mkdir -p .github/unity-project/Packages/com.chocopoi.vrc.dressingframework
mv [!.github]* .github/unity-project/Packages/com.chocopoi.vrc.dressingframework/
mv .github/unity-project/* .
rm -rf .github/unity-project
ls -l
ls -l Packages/com.chocopoi.vrc.dressingframework
# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.unity-version }}-${{ matrix.import-vrcsdk }}-${{ matrix.import-dynbone }}-${{ matrix.import-univrm }}-${{ matrix.import-ma }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-${{ matrix.unity-version }}-${{ matrix.import-vrcsdk }}-${{ matrix.import-dynbone }}-${{ matrix.import-univrm }}-${{ matrix.import-ma }}-
- name: Prepare ProjectVersion
run: mv ProjectSettings/ProjectVersion.${{ matrix.unity-version }}.txt ProjectSettings/ProjectVersion.txt
- name: Use UniVRM manifest
if: matrix.import-univrm
run: mv Packages/manifest-vrm.json Packages/manifest.json
- name: Resolve VPM Project
if: matrix.import-vrcsdk
run: |
mv Packages/vpm-manifest.${{ matrix.unity-version }}.json Packages/vpm-manifest.json
dotnet tool install --global vrchat.vpm.cli
vpm add repo https://vpm.chocopoi.com/index.json
vpm resolve project
- name: Import ModularAvatar
if: matrix.import-ma
run: |
vpm add repo https://vpm.nadena.dev/vpm.json
vpm add package [email protected]
# DynamicsBones stub
- name: Import DynamicBones stub
if: matrix.import-dynbone
run: |
wget -O Dynamic-Bones-Stub-main.zip https://github.com/VRLabs/Dynamic-Bones-Stub/archive/refs/heads/main.zip
unzip Dynamic-Bones-Stub-main.zip
ls -l Dynamic-Bones-Stub-main
cp -rfv Dynamic-Bones-Stub-main/Scripts Assets/Scripts
# Test
- name: Run tests
uses: game-ci/unity-test-runner@v4
id: tests
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
unityVersion: ${{ matrix.unity-version }}
# we have too many tests, exceeded the github limit
# https://github.com/game-ci/unity-test-runner/issues/142
# githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: 'all'
customParameters: '-assemblyNames "com.chocopoi.vrc.dressingframework.Editor.Tests;com.chocopoi.vrc.dressingframework.Runtime.Tests" -nographics'
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+com.chocopoi.vrc.dressingframework.Editor,+com.chocopoi.vrc.dressingframework.Runtime'
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test results (${{ matrix.unity-version }}${{ matrix.import-vrcsdk && ', VRC' || '' }}${{ matrix.import-dynbone && ', DynBone' || '' }}${{ matrix.import-univrm && ', VRM' || '' }})
path: artifacts
# Upload coverage report to GitHub
- uses: actions/upload-artifact@v3
if: always()
with:
name: Coverage results (${{ matrix.unity-version }}${{ matrix.import-vrcsdk && ', VRC' || '' }}${{ matrix.import-dynbone && ', DynBone' || '' }}${{ matrix.import-univrm && ', VRM' || '' }})
path: ${{ steps.tests.outputs.coveragePath }}
# Upload coverage report to Codecov
- name: Upload XML report to Codecov
uses: codecov/codecov-action@v3
with:
flags: automated
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.tests.outputs.coveragePath }}/**/*.xml