This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (77 loc) · 2.67 KB
/
validate.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
name: validate
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
UNITY_PROJECT_PATH: ''
jobs:
validate:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
#max-parallel: 2 # Use this if you're activating pro license with matrix
matrix:
include:
- os: ubuntu-latest
build-target: StandaloneLinux64
- os: windows-latest
build-target: StandaloneWindows64
- os: macos-13
build-target: StandaloneOSX
steps:
- name: checkout self
uses: actions/checkout@v4
- run: npm install
- name: checkout test project
uses: actions/checkout@v4
with:
repository: xrtk/com.xrtk.test
path: test-project
# Installs the Unity Editor based on your project version text file
# sets -> env.UNITY_EDITOR_PATH
# sets -> env.UNITY_PROJECT_PATH
# https://github.com/XRTK/unity-setup
- uses: xrtk/unity-setup@development
with:
version-file-path: 'test-project/**/ProjectSettings/ProjectVersion.txt'
build-targets: ${{ matrix.build-target }}
# Activates the installation with the provided credentials
# https://github.com/XRTK/activate-unity-license
- name: xrtk/activate-unity-license
uses: ./
with:
# Required
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
# Optional
license-type: 'Personal' # Chooses license type to use [ Personal, Professional ]
# serial: ${{ secrets.UNITY_SERIAL }} # Required for pro/plus activations
auth-key: ${{ secrets.UNITY_2FA_KEY }} # required for personal activations
- name: Unity Build (${{ matrix.build-target }})
uses: xrtk/unity-action@v6
with:
log-name: 'project-validation'
args: '-quit -nographics -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject'
- uses: actions/upload-artifact@v4
name: Upload Artifacts
if: always()
with:
name: '${{ runner.os }}-${{ matrix.build-target }}-Artifacts'
path: '${{ env.UNITY_PROJECT_PATH }}/Builds'
- name: Clean Artifacts
if: always()
run: |
# Clean Artifacts
$artifacts = "${{ env.UNITY_PROJECT_PATH }}/Builds"
if (Test-Path -Path $artifacts) {
Remove-Item $artifacts -Force -Recurse
}
shell: pwsh