-
Notifications
You must be signed in to change notification settings - Fork 4
117 lines (107 loc) · 3.13 KB
/
test_and_build.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
name: GothicVR Build Jobs
on:
pull_request:
branches:
- main
types: [labeled]
# We will reuse it once we define release pipeline
# push:
# branches:
# - main
# paths-ignore:
# - 'docs/**'
# - "README.md"
jobs:
#########
# TESTS #
#########
Unit_Tests:
if: ${{ github.event.label.name == 'Pipeline' }}
name: Test in ${{ matrix.testMode }}
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
testMode:
- playmode
- editmode
steps:
- uses: actions/checkout@v3
with:
lfs: true
fetch-depth: 0
clean: true
- uses: actions/cache@v3
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}
restore-keys: |
Library-
- uses: game-ci/unity-test-runner@v3
id: tests
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
testMode: ${{ matrix.testMode }}
artifactsPath: ${{ matrix.testMode }}-artifacts
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: ${{ matrix.testMode }} Test Results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*'
- uses: actions/upload-artifact@v3
if: always()
with:
name: Test results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.artifactsPath }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: Coverage results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.coveragePath }}
#########
# BUILD #
#########
buildForAllPlatforms:
if: ${{ github.event.label.name == 'Pipeline' }}
name: Build GothicVR for ${{ matrix.targetDevice }}
needs: Unit_Tests
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
include:
- targetPlatform: StandaloneWindows64
targetDevice: Windows64
- targetPlatform: Android
targetDevice: Pico
- targetPlatform: Android
targetDevice: Quest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v3
with:
lfs: true
fetch-depth: 0
clean: true
# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
# Build
- name: Build project
uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
allowDirtyBuild: true
buildMethod: GVR.Editor.UnityBuildTools.UnityBuilderAction.Perform${{ matrix.targetDevice }}Build
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetDevice }}
path: build/${{ matrix.targetDevice }}
expire-in: 2 days