-
Notifications
You must be signed in to change notification settings - Fork 34
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
d83e44a
commit 346d06e
Showing
1 changed file
with
30 additions
and
37 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,59 +1,52 @@ | ||
name: Test Untiy | ||
name: Test package | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Build my project ✨ | ||
testAllModes: | ||
name: Test in ${{ matrix.testMode }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
projectPath: | ||
- test-package | ||
unityVersion: "2020.3.0f1" # some version must be included for package testing | ||
testMode: | ||
- playmode | ||
- editmode | ||
steps: | ||
# Checkout | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
# Cache | ||
- uses: actions/cache@v3 | ||
with: | ||
path: Library | ||
key: Library-${{ hashFiles('Demo~/Assets/**', 'Demo~/Packages/**', 'Demo~/ProjectSettings/**') }} | ||
restore-keys: | | ||
Library- | ||
- name: set a correct package path | ||
run: | | ||
pwd | ||
folderName=$(echo "${PWD##*/}") | ||
rsync -r "$GITHUB_WORKSPACE" "package" | ||
ls -F "package/$folderName" | ||
# Test | ||
- name: Run tests | ||
uses: game-ci/unity-test-runner@v4 | ||
rsync -r "$GITHUB_WORKSPACE" "${{ matrix.projectPath }}" | ||
ls -F "${{ matrix.projectPath }}/$folderName" | ||
- uses: game-ci/unity-test-runner@v4 | ||
id: tests | ||
env: | ||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
with: | ||
projectPath: ./package/backtrace-unity | ||
packageMode: true | ||
unityVersion: "2020.3.0f1" | ||
projectPath: ${{ matrix.projectPath }} | ||
unityVersion: ${{ matrix.unityVersion }} | ||
testMode: ${{ matrix.testMode }} | ||
artifactsPath: ${{ matrix.testMode }}-artifacts | ||
checkName: ${{ matrix.testMode }} Test Results | ||
coverageOptions: "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+my.assembly.*" | ||
|
||
# Build | ||
- name: Build project | ||
uses: game-ci/unity-builder@v4 | ||
env: | ||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | ||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | ||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
projectPath: ./package/backtrace-unity | ||
targetPlatform: WebGL | ||
packageMode: true | ||
|
||
# Output | ||
name: Test results for ${{ matrix.testMode }} | ||
path: ${{ steps.tests.outputs.artifactsPath }} | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: Build | ||
path: build | ||
name: Coverage results for ${{ matrix.testMode }} | ||
path: ${{ steps.tests.outputs.coveragePath }} |