Skip to content

Commit

Permalink
feat: add script to retrieve Playwright version and cache binaries in…
Browse files Browse the repository at this point in the history
… workflow (#59)
  • Loading branch information
yk-lab authored Feb 16, 2025
1 parent 39e05a9 commit c38fea6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/scripts/get-playwright-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -euo pipefail

playwright_version=$(pnpm list --depth 1 --json | jq -r '.[].devDependencies["@playwright/test"].version')

echo "Found Playwright version: $playwright_version"
echo "version=$playwright_version" >>"$GITHUB_OUTPUT"
19 changes: 16 additions & 3 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,24 @@ jobs:
node-version-file: 'package.json'
cache: 'pnpm'
- run: pnpm install
- name: Get installed Playwright version
id: playwright-version
run: .github/scripts/get-playwright-version.sh
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
restore-keys: ${{ runner.os }}-playwright-
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- run: pnpm lint
- run: pnpm run build
- run: pnpm test
- name: Run linting
run: pnpm lint
- name: Build the project
run: pnpm run build
- name: Run tests
run: pnpm test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
Expand Down

0 comments on commit c38fea6

Please sign in to comment.