-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08c4a78
commit 05c98b7
Showing
4 changed files
with
101 additions
and
184 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "XRTK CI Workflow", | ||
"description": "XRTK CI workflow template for unity projects.", | ||
"iconName": "xrtk", | ||
"categories": [ | ||
"C#" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: XRTK CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
validate: | ||
runs-on: self-hosted | ||
outputs: | ||
editor-path: ${{ steps.unity-validate.outputs.editor-path }} | ||
project-path: ${{ steps.unity-validate.outputs.project-path }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- id: unity-validate | ||
uses: xrtk/unity-validate@main | ||
|
||
- uses: xrtk/unity-action@main | ||
name: 'project-validation' | ||
with: | ||
name: 'project-validation' | ||
editor-path: '${{ steps.unity-validate.outputs.editor-path }}' | ||
project-path: '${{ steps.unity-validate.outputs.project-path }}' | ||
args: '-quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject' | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: 'Validation-Results' | ||
path: '${{ steps.unity-validate.outputs.project-path }}\Builds\Logs' | ||
|
||
- name: cleanup | ||
run: | | ||
$logDirectory = "${{ steps.unity-validate.outputs.project-path }}\Builds" | ||
if (Test-Path -Path $logDirectory) { | ||
Remove-Item $logDirectory -Force -Recurse | ||
} | ||
shell: powershell | ||
|
||
build: | ||
needs: validate | ||
runs-on: self-hosted | ||
strategy: | ||
matrix: | ||
build-target: [StandaloneWindows64, WSAPlayer, Android, Lumin] | ||
max-parallel: 1 | ||
|
||
steps: | ||
- uses: xrtk/unity-action@main | ||
name: '${{ matrix.build-target }}-Tests' | ||
with: | ||
name: '${{ matrix.build-target }}-Tests' | ||
editor-path: '${{ needs.validate.outputs.editor-path }}' | ||
project-path: '${{ needs.validate.outputs.project-path }}' | ||
build-target: '${{ matrix.build-target }}' | ||
args: '-batchmode -runEditorTests' | ||
|
||
- uses: xrtk/unity-action@main | ||
name: '${{ matrix.build-target }}-Build' | ||
with: | ||
name: '${{ matrix.build-target }}-Build' | ||
editor-path: '${{ needs.validate.outputs.editor-path }}' | ||
project-path: '${{ needs.validate.outputs.project-path }}' | ||
build-target: '${{ matrix.build-target }}' | ||
args: '-quit -batchmode -executeMethod XRTK.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild' | ||
|
||
- name: 'zip artifacts' | ||
if: always() | ||
run: | | ||
$artifacts = "${{ needs.validate.outputs.project-path }}\Builds" | ||
if (Test-Path -Path $artifacts) { | ||
Compress-Archive -Path "$artifacts\*" -DestinationPath ${{ github.workspace }}\${{ matrix.build-target }}-Artifacts.zip | ||
Remove-Item $artifacts -Force -Recurse | ||
} | ||
shell: powershell | ||
|
||
- uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: '${{ matrix.build-target }}-Artifacts' | ||
path: '${{ github.workspace }}\${{ matrix.build-target }}-Artifacts.zip' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.