This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
xrtk/[email protected] #264
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-latest | |
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@v7 | |
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 |