build: update actions and node 20 #1246
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Playwright Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test_setup: | |
name: Test setup | |
runs-on: macos-12 | |
outputs: | |
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }} | |
steps: | |
- name: Wait for Vercel preview deployment to be ready | |
uses: patrickedqvist/wait-for-vercel-preview@v1.3.2 | |
id: waitForVercelPreviewDeployment | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
max_timeout: 600 | |
test_e2e: | |
needs: test_setup | |
timeout-minutes: 60 | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8.x | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
# https://playwrightsolutions.com/playwright-github-action-to-cache-the-browser-binaries/ | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV | |
- name: Cache playwright binaries | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: ~/Library/Caches/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
# Install browsers | |
- run: pnpm playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
# Install system requirement for installed browsers | |
- run: pnpm playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: Run Playwright tests | |
run: pnpm playwright test | |
env: | |
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.test_setup.outputs.preview_url }} |