From 2b9367b2156485c9a6e2ae9aa159d145526e261b Mon Sep 17 00:00:00 2001 From: mii288 Date: Fri, 13 Dec 2024 18:42:00 +0900 Subject: [PATCH] =?UTF-8?q?fixup!=20feat(vrt):=20base=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=B3=E3=83=81=E3=81=AE=E5=B7=AE=E5=88=86=E3=81=A8=E6=AF=94?= =?UTF-8?q?=E8=BC=83=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/screenshots/action.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/actions/screenshots/action.yml b/.github/actions/screenshots/action.yml index c94bfdb..784ab7b 100644 --- a/.github/actions/screenshots/action.yml +++ b/.github/actions/screenshots/action.yml @@ -12,7 +12,7 @@ inputs: outputs: cache-key: description: the cache key name - value: vrt-${{ steps.latest-commit.outputs.sha }} + value: ${{ steps.cache.outputs.key }} runs: using: composite @@ -22,18 +22,21 @@ runs: with: ref: ${{ inputs.ref }} clean: false - - name: Check latest commit hash - id: latest-commit + - name: Set cache key + id: cache run: | + # `git rev-parse HEAD`実行時にwarningが発生する問題の対応策 git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }} - echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + + # テストケース自体に変更がある場合はキャッシュを使わず、スクリーンショットを撮影し直す + echo "key=vrt-$(git rev-parse HEAD)-${{ hashFiles('playwright.config.ts', 'tests/vrt.spec.ts') }}" >> "$GITHUB_OUTPUT" shell: bash - name: Restore screenshots id: vrt-screenshots uses: actions/cache@v4 with: path: ${{ inputs.path }} - key: vrt-${{ steps.latest-commit.outputs.sha }} + key: ${{ steps.cache.outputs.key }} - if: ${{ steps.vrt-screenshots.outputs.cache-hit != 'true' }} name: Install Japanese fonts run: |