ci: cache playwright browsers

This commit is contained in:
Kim, Jimin 2023-07-29 09:32:31 +09:00
parent 7920c64e33
commit 1d5c1b0af2
Signed by: pomp
GPG key ID: CE1DDB8A4A765403

View file

@ -25,10 +25,24 @@ jobs:
node-version: 18
cache: pnpm
- name: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Install dependencies
run: pnpm install
- name: Install playwright browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run tests