Fix Play Mode tests on Linux #240
This file contains hidden or 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
| name: Test Companion App | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: {} | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| PROJECT_PATH: UltraStar Play Companion | |
| jobs: | |
| test-job: | |
| name: Test for ${{ matrix.targetPlatform }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| unityVersion: | |
| - 6000.1.3f1 | |
| targetPlatform: | |
| - Android | |
| - iOS | |
| steps: | |
| # Clone repo and restore cache | |
| - name: Clone Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Restore Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.PROJECT_PATH }}/Library | |
| key: Library-${{ env.PROJECT_PATH }}-${{ matrix.targetPlatform }}-${{ hashFiles(env.PROJECT_PATH) }} | |
| restore-keys: | | |
| Library-${{ env.PROJECT_PATH }}-${{ matrix.targetPlatform }}- | |
| Library-${{ env.PROJECT_PATH }}- | |
| Library- | |
| # Run setup script | |
| - name: Restore Dependencies | |
| run: bash build.sh RestoreCompanionAppDependencies | |
| # Test Unity project | |
| - name: Test Unity Project | |
| uses: game-ci/unity-test-runner@v4 | |
| id: testRunner | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| with: | |
| projectPath: ${{ env.PROJECT_PATH }} | |
| unityVersion: ${{ matrix.unityVersion }} | |
| testMode: all | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| customParameters: "-nographics" | |
| # Upload test results for download | |
| - name: Upload Test Results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: Test results ${{ matrix.targetPlatform }} | |
| path: ${{ steps.testRunner.outputs.artifactsPath }} | |
| # Publish test report to GitHub UI | |
| - name: Publish Test Report | |
| if: always() | |
| uses: dorny/test-reporter@v2 | |
| with: | |
| name: Test report ${{ matrix.targetPlatform }} | |
| path: ${{ steps.testRunner.outputs.artifactsPath }}/*.xml | |
| reporter: dotnet-nunit |