meta: enable turbopack on static mode #572
Workflow file for this run
This file contains hidden or 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
# Security Notes | |
# Only selected Actions are allowed within this repository. Please refer to (https://github.com/nodejs/nodejs.org/settings/actions) | |
# for the full list of available actions. If you want to add a new one, please reach out a maintainer with Admin permissions. | |
# REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!! | |
# AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags. | |
# MERGE QUEUE NOTE: This Workflow does not run on `merge_group` trigger, as this Workflow is not required for Merge Queue's | |
name: Playwright Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
actions: read | |
jobs: | |
get-vercel-preview: | |
name: Get Vercel Preview | |
runs-on: ubuntu-latest | |
outputs: | |
deployment_found: ${{ steps.set_outputs.outputs.deployment_found }} | |
url: ${{ steps.set_outputs.outputs.url }} | |
steps: | |
- name: Capture Vercel Preview | |
id: check_deployment | |
uses: patrickedqvist/wait-for-vercel-preview@06c79330064b0e6ef7a2574603b62d3c98789125 # v1.3.2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
max_timeout: 300 # timeout after 5 minutes | |
check_interval: 10 # check every 10 seconds | |
continue-on-error: true | |
- name: Set Outputs | |
if: always() | |
id: set_outputs | |
run: | | |
if [[ -z "${{ steps.check_deployment.outputs.url }}" ]]; then | |
echo "deployment_found=false" >> $GITHUB_OUTPUT | |
else | |
echo "deployment_found=true" >> $GITHUB_OUTPUT | |
echo "url=${{ steps.check_deployment.outputs.url }}" >> $GITHUB_OUTPUT | |
fi | |
playwright: | |
needs: get-vercel-preview | |
if: needs.get-vercel-preview.outputs.deployment_found == 'true' | |
name: Playwright Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2 | |
with: | |
egress-policy: audit | |
- name: Git Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 2 | |
- name: Set up pnpm | |
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
- name: Set up Node.js | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
with: | |
# We want to ensure that the Node.js version running here respects our supported versions | |
node-version-file: '.nvmrc' | |
cache: 'pnpm' | |
- name: Install packages | |
run: pnpm install --frozen-lockfile | |
- name: Get Playwright version | |
id: playwright-version | |
working-directory: apps/site | |
run: echo "version=$(node_modules/.bin/playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- name: Cache Playwright browsers | |
id: playwright-cache | |
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | |
with: | |
path: ~/.cache/ms-playwright | |
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} | |
- name: Install Playwright Browsers | |
working-directory: apps/site | |
run: node_modules/.bin/playwright install --with-deps | |
- name: Run Playwright tests | |
working-directory: apps/site | |
run: node --run playwright | |
env: | |
PLAYWRIGHT_BASE_URL: ${{ needs.get-vercel-preview.outputs.url }} | |
- name: Upload Playwright test results | |
if: always() | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: playwright-report | |
path: apps/site/playwright-report/ |