Skip to content

Commit

Permalink
[code-infra] Remove custom playwright installation steps (#4154)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Sep 30, 2024
1 parent d4aee59 commit 4d33d35
Showing 1 changed file with 8 additions and 32 deletions.
40 changes: 8 additions & 32 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ default-job: &default-job
docker:
- image: cimg/node:20.17
environment:
# Keep in sync with "Save playwright cache"
PLAYWRIGHT_BROWSERS_PATH: /tmp/pw-browsers
COREPACK_ENABLE_DOWNLOAD_PROMPT: '0'

default-context: &default-context
context:
Expand All @@ -36,27 +35,18 @@ commands:
- when:
condition: << parameters.browsers >>
steps:
- run: corepack enable
- run:
name: Install pnpm package manager
command: corepack enable
- when:
condition:
not: << parameters.browsers >>
steps:
# See https://stackoverflow.com/a/73411601
- run: corepack enable --install-directory ~/bin

- when:
condition: << parameters.browsers >>
steps:
- run:
name: Prepare playwright hash
command: pnpm list --json --filter playwright > /tmp/playwright_info.json
- store_artifacts:
name: Debug playwright hash
path: /tmp/playwright_info.json
- restore_cache:
name: Restore playwright cache
keys:
- v5-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
name: Install pnpm package manager
# See https://stackoverflow.com/a/73411601
command: corepack enable --install-directory ~/bin

- run:
name: View install environment
command: |
Expand All @@ -65,20 +55,6 @@ commands:
- run:
name: Install js dependencies
command: pnpm install
- when:
condition: << parameters.browsers >>
steps:
- run:
name: Install playwright browsers
command: pnpm playwright install --with-deps

- save_cache:
name: Save playwright cache
key: v5-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
paths:
# Keep path in sync with "PLAYWRIGHT_BROWSERS_PATH"
# Can't use environment variables for `save_cache` paths (tested in https://app.circleci.com/pipelines/github/mui/material-ui/37813/workflows/5b1e207f-ac8b-44e7-9ba4-d0f9a01f5c55/jobs/223370)
- /tmp/pw-browsers

jobs:
checkout:
Expand Down

0 comments on commit 4d33d35

Please sign in to comment.