1- # Copyright (c) 2021-2023 Koji Hasegawa.
1+ # Copyright (c) 2021-2025 Koji Hasegawa.
22# This software is released under the MIT License.
33
44name : Test
@@ -22,7 +22,7 @@ concurrency:
2222 group : ${{ github.workflow }}-${{ github.ref }}
2323 cancel-in-progress : true
2424
25- permissions : {}
25+ permissions : { }
2626
2727defaults :
2828 run :
3232 test :
3333 if : github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
3434 runs-on : ubuntu-latest
35- timeout-minutes : 15
35+ timeout-minutes : 20
3636 permissions :
3737 contents : read
3838 checks : write
@@ -62,21 +62,23 @@ jobs:
6262 submodules : false
6363 lfs : false
6464
65- - uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
65+ - name : Restore cache
66+ uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
6667 with :
6768 path : Library
68- key : Library-linux -${{ matrix.unityVersion }}-${{ github.ref }}
69+ key : Library-${{ runner.os }} -${{ matrix.unityVersion }}-${{ hashFiles('Packages/packages-lock.json') }}
6970 restore-keys : |
70- Library-linux -${{ matrix.unityVersion }}
71- Library-linux
72- Library
71+ Library-${{ runner.os }} -${{ matrix.unityVersion }}-
72+ Library-${{ runner.os }}-
73+ Library-
7374
7475 - name : Set coverage assembly filters
7576 run : |
7677 assemblies=$(find ./Packages -name "*.asmdef" | sed -e s/.*\\//\+/ | sed -e s/\\.asmdef// | sed -e s/^.*\\.Tests//)
7778 assemblies+=("+LocalPackageSample*")
7879 # shellcheck disable=SC2001,SC2048,SC2086
7980 echo "assembly_filters=+<assets>,$(echo ${assemblies[*]} | sed -e s/\ /,/g),-*.Tests" >> "$GITHUB_ENV"
81+ if : ${{ matrix.octocov }}
8082
8183 - name : Set license secret key
8284 run : echo "secret_key=UNITY_LICENSE_$(echo ${{ matrix.unityVersion }} | cut -c 1-4)" >> "$GITHUB_ENV"
8789 githubToken : ${{ secrets.GITHUB_TOKEN }}
8890 unityVersion : ${{ matrix.unityVersion }} # Default is `auto`
8991 checkName : test result (${{ matrix.unityVersion }}, ${{ matrix.testMode }})
90- customParameters : -testCategory "!IgnoreCI;!Integration"
92+ customParameters : -testCategory "!IgnoreCI;!Integration" -testHelperScreenshotDirectory /github/workspace/artifacts/Screenshots
93+ # Note: `/github/workspace/artifacts` is the artifacts path inside the game-ci container
9194 coverageOptions : generateAdditionalMetrics;generateTestReferences;generateHtmlReport;generateAdditionalReports;dontClear;assemblyFilters:${{ env.assembly_filters }}
9295 # see: https://docs.unity3d.com/Packages/[email protected] /manual/CoverageBatchmode.html 9396 testMode : ${{ matrix.testMode }}
@@ -113,17 +116,3 @@ jobs:
113116 ${{ steps.test.outputs.artifactsPath }}
114117 ${{ steps.test.outputs.coveragePath }}
115118 if : always()
116-
117- notify :
118- needs : test
119- if : github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
120- runs-on : ubuntu-latest
121- timeout-minutes : 5
122- permissions :
123- actions : read
124-
125- steps :
126- - uses : Gamesight/slack-workflow-status@68bf00d0dbdbcb206c278399aa1ef6c14f74347a # v1.3.0
127- with :
128- repo_token : ${{ secrets.GITHUB_TOKEN }}
129- slack_webhook_url : ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments