Skip to content

Commit d89bf7d

Browse files
committed
Fix workflow cache key
1 parent 06ca5b9 commit d89bf7d

File tree

2 files changed

+21
-45
lines changed

2 files changed

+21
-45
lines changed

.github/workflows/test-integration.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021-2023 Koji Hasegawa.
1+
# Copyright (c) 2021-2025 Koji Hasegawa.
22
# This software is released under the MIT License.
33

44
name: Integration Test
@@ -22,7 +22,7 @@ concurrency:
2222
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.inputs.runner }}
2323
cancel-in-progress: true
2424

25-
permissions: {}
25+
permissions: { }
2626

2727
defaults:
2828
run:
@@ -32,7 +32,7 @@ jobs:
3232
test:
3333
if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
3434
runs-on: ${{ github.event.inputs.runner }}
35-
timeout-minutes: 15
35+
timeout-minutes: 20
3636
permissions:
3737
contents: read
3838
checks: write
@@ -59,14 +59,15 @@ jobs:
5959
submodules: false
6060
lfs: false
6161

62-
- uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4
62+
- name: Restore cache
63+
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4
6364
with:
6465
path: Library
65-
key: Library-linux-${{ matrix.unityVersion }}-${{ github.ref }}
66+
key: Library-${{ runner.os }}-${{ matrix.unityVersion }}-${{ hashFiles('Packages/packages-lock.json') }}
6667
restore-keys: |
67-
Library-linux-${{ matrix.unityVersion }}
68-
Library-linux
69-
Library
68+
Library-${{ runner.os }}-${{ matrix.unityVersion }}-
69+
Library-${{ runner.os }}-
70+
Library-
7071
7172
- name: Set coverage assembly filters
7273
run: |
@@ -102,17 +103,3 @@ jobs:
102103
${{ steps.test.outputs.artifactsPath }}
103104
${{ steps.test.outputs.coveragePath }}
104105
if: always()
105-
106-
notify:
107-
needs: test
108-
if: github.event.pull_request.head.repo.fork == false # Skip on public fork, because can not read secrets.
109-
runs-on: ubuntu-latest
110-
timeout-minutes: 5
111-
permissions:
112-
actions: read
113-
114-
steps:
115-
- uses: Gamesight/slack-workflow-status@68bf00d0dbdbcb206c278399aa1ef6c14f74347a # v1.3.0
116-
with:
117-
repo_token: ${{ secrets.GITHUB_TOKEN }}
118-
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/test.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021-2023 Koji Hasegawa.
1+
# Copyright (c) 2021-2025 Koji Hasegawa.
22
# This software is released under the MIT License.
33

44
name: Test
@@ -22,7 +22,7 @@ concurrency:
2222
group: ${{ github.workflow }}-${{ github.ref }}
2323
cancel-in-progress: true
2424

25-
permissions: {}
25+
permissions: { }
2626

2727
defaults:
2828
run:
@@ -32,7 +32,7 @@ jobs:
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"
@@ -87,7 +89,8 @@ jobs:
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

Comments
 (0)