-
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
Showing
2 changed files
with
91 additions
and
29 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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
name: Actions 😎 | ||
name: Builds | ||
|
||
on: [push, pull_request] | ||
on: | ||
workflow_run: | ||
workflows: ["Tests"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
buildForAllSupportedPlatforms: | ||
|
@@ -10,6 +14,8 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
projectPath: | ||
- Unity_ExperimentLibrary | ||
targetPlatform: | ||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit). | ||
- StandaloneWindows # Build a Windows standalone. | ||
|
@@ -40,38 +46,17 @@ jobs: | |
# Cache | ||
- uses: actions/cache@v3 | ||
with: | ||
path: Library | ||
path: ${{ matrix.projectPath }}/Library | ||
key: | ||
Library-${{ matrix.targetPlatform }}-${{ hashFiles('Assets/**', 'Packages/**', | ||
'ProjectSettings/**') }} | ||
restore-keys: | | ||
Library-${{ matrix.targetPlatform }}- | ||
Library- | ||
# Test | ||
- name: Run tests | ||
id: myTestStep | ||
uses: game-ci/unity-test-runner@v4 | ||
env: | ||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
with: | ||
projectPath: Unity_ExperimentLibrary | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: Test results ${{ matrix.targetPlatform }} | ||
path: ${{ steps.myTestStep.outputs.artifactsPath }} | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: Coverage results | ||
path: ${{ steps.myTestStep.outputs.coveragePath }} | ||
# Android specific : Free disk space | ||
- if: matrix.targetPlatform == 'Android' | ||
uses: jlumbroso/[email protected] | ||
|
||
# Build | ||
- name: Build project | ||
|
@@ -82,8 +67,7 @@ jobs: | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
with: | ||
targetPlatform: ${{ matrix.targetPlatform }} | ||
versioning: Semantic | ||
projectPath: Unity_ExperimentLibrary | ||
projectPath: ${{ matrix.projectPath }} | ||
|
||
# Output | ||
- uses: actions/upload-artifact@v3 | ||
|
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,78 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Test in ${{ matrix.testMode }} | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
projectPath: | ||
- Unity_ExperimentLibrary | ||
testMode: | ||
- playmode | ||
- editmode | ||
- standalone | ||
steps: | ||
# Checkout (without LFS) | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Git LFS | ||
- name: Create LFS file list | ||
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id | ||
|
||
- name: Restore LFS cache | ||
uses: actions/cache@v3 | ||
id: lfs-cache | ||
with: | ||
path: .git/lfs | ||
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }} | ||
|
||
- name: Git LFS Pull | ||
run: | | ||
git lfs pull | ||
git add . | ||
git reset --hard | ||
# Cache | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ matrix.projectPath }}/Library | ||
key: | ||
Library-${{ matrix.projectPath }}-${{ hashFiles('Assets/**', 'Packages/**', | ||
'ProjectSettings/**') }} | ||
restore-keys: | | ||
Library- | ||
# Test | ||
- name: Run tests | ||
id: tests | ||
uses: game-ci/unity-test-runner@v4 | ||
env: | ||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
with: | ||
projectPath: ${{ matrix.projectPath }} | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
testMode: ${{ matrix.testMode }} | ||
artifactsPath: ${{ matrix.testMode }}-artifacts | ||
checkName: ${{ matrix.testMode }} Test Results | ||
coverageOptions: "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*" | ||
|
||
- name: Upload test results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
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 }} |