generated from vrchat-community/template-package
-
-
Notifications
You must be signed in to change notification settings - Fork 15
145 lines (128 loc) · 5.08 KB
/
run-tests.yml
File metadata and controls
145 lines (128 loc) · 5.08 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Run Tests
on:
workflow_dispatch:
push:
paths-ignore:
- '.docfx/**'
- '*.md'
- '.gitignore'
pull_request_target:
paths-ignore:
- '.docfx/**'
- '*.md'
- '.gitignore'
env:
PROJECT_PATH: .
PACKAGE_PATH: ./Packages/${{ github.event.repository.name }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
jobs:
test:
name: Test in ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }}
permissions:
checks: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
- 6000.0.51f1
- 6000.1.8f1
testMode:
- playmode
- standalone
vpmPackages:
- []
include:
- unityVersion: 2022.3.22f1
testMode: editmode
vpmPackages:
- com.vrchat.base
- nadena.dev.ndmf
- unityVersion: 2022.3.22f1
testMode: editmode
vpmPackages:
- nadena.dev.modular-avatar
steps:
- name: Create package testing project
uses: RamType0/create-unity-project@v0.2.0
with:
projectPath: ${{ env.PROJECT_PATH }}
unityVersion: ${{ matrix.unityVersion }}
# com.vrchat.base is missing dependency to com.unity.modules.video
# com.unity.xr.oculus (Referenced by com.vrchat.base) is missing dependency to com.unity.modules.androidjni
# Until https://github.com/bdunderscore/ndmf/pull/655 is merged into stable version, we need to define com.unity.modules.animation dependency explicitly.
manifest: |
{
"dependencies": {
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.testtools.codecoverage": "1.2.6"
}
}
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ env.PACKAGE_PATH }}
submodules: recursive
- name: Setup vrc-get
uses: anatawa12/sh-actions/setup-vrc-get@master
- name: Add Ram.Type-0 VPM repo
run: vrc-get repo add https://ramtype0.github.io/VpmRepository/index.json
- name: Add bd_ VPM repo
run: vrc-get repo add https://vpm.nadena.dev/vpm.json
- name: Install VPM packages
working-directory: ${{ env.PROJECT_PATH }}
run: |
printf '%s\n' "$VPM_PACKAGES" | while IFS= read -r package; do
if [ -n "${package:-}" ]; then
echo "installing $package" >&2
vrc-get install -y "$package"
fi
done
shell: bash
env:
VPM_PACKAGES: ${{ join(matrix.vpmPackages, fromJSON('"\n"')) }}
- name: Resolve VPM packages
run: vrc-get resolve
- name: Create LFS file list
working-directory: ${{ env.PACKAGE_PATH }}
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v3
with:
path: ${{ env.PACKAGE_PATH }}/.git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('./.lfs-assets-id') }}
- name: Git LFS Pull
working-directory: ${{ env.PACKAGE_PATH }}
run: |
git lfs pull
git add .
git reset --hard
- uses: actions/cache@v3
with:
path: ${{ env.PROJECT_PATH }}/Library
key: Library-${{ hashFiles('${{ env.PROJECT_PATH }}/Assets/**', '${{ env.PROJECT_PATH }}/Packages/**', '${{ env.PROJECT_PATH }}/ProjectSettings/**') }}
restore-keys: |
Library-
- uses: game-ci/unity-test-runner@v4
with:
unityVersion: ${{ matrix.unityVersion }}
testMode: ${{ matrix.testMode }}
artifactsPath: ${{ matrix.testMode }}-artifacts
githubToken: ${{ github.token }}
checkName: ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }} Test Results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+Meshia.MeshSimplification.*'
projectPath: ${{ env.PROJECT_PATH }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results for ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }}
path: ${{ env.PROJECT_PATH }}/${{ steps.tests.outputs.artifactsPath }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: Coverage results for ${{ matrix.testMode }} on ${{ matrix.unityVersion }}${{ matrix.vpmPackages[0] != null && ' with VPM packages ' || '' }}${{ join(matrix.vpmPackages, ', ') }}
path: ${{ env.PROJECT_PATH }}/${{ steps.tests.outputs.coveragePath }}