Skip to content

Commit

Permalink
renamed template workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Sep 30, 2021
1 parent 08c4a78 commit 05c98b7
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 184 deletions.
8 changes: 8 additions & 0 deletions workflow-templates/build.properties.json
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#"
]
}
93 changes: 93 additions & 0 deletions workflow-templates/build.yml
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'
8 changes: 0 additions & 8 deletions workflow-templates/upm-build.properties.json

This file was deleted.

176 changes: 0 additions & 176 deletions workflow-templates/upm-build.yml

This file was deleted.

0 comments on commit 05c98b7

Please sign in to comment.