Skip to content

Commit

Permalink
✨ Create TestAndCoverageUnityPackage.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
soo-bak committed Jul 7, 2024
1 parent 2eea41a commit 0260acd
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/TestAndCoverageUnityPackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test and Coverage for Unity Package

on:
pull_request:
branches:
- main

jobs:
testAllModes:
name: Test in ${{ matrix.testMode }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- packages/com.yourcompany.yourpackage
unityVersion: '2022.3.0f1'
testMode:
- playmode
- editmode
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Run Unity Tests
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:
packageMode: true
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
testMode: ${{ matrix.testMode }}
artifactsPath: ${{ matrix.testMode }}-artifacts
githubToken: ${{ github.token }}
checkName: ${{ matrix.testMode }} Test Results
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+com.yourcompany.yourpackage.*'

- name: Upload Test Results
uses: actions/upload-artifact@v3
if: always()
with:
name: Test results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.artifactsPath }}

- name: Upload Coverage Results
uses: actions/upload-artifact@v3
if: always()
with:
name: Coverage results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.coveragePath }}

0 comments on commit 0260acd

Please sign in to comment.