Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add script to retrieve Playwright version and cache binaries in… #59

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading