Skip to content

Commit

Permalink
[code-infra] Remove custom playwright installation steps (#14728)
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot authored Sep 27, 2024
1 parent c36a8d5 commit 31dde46
Showing 1 changed file with 6 additions and 38 deletions.
44 changes: 6 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ default-job: &default-job
type: string
default: << pipeline.parameters.e2e-base-url >>
environment:
# Keep in sync with "Save playwright cache"
PLAYWRIGHT_BROWSERS_PATH: /tmp/pw-browsers
# expose it globally otherwise we have to thread it from each job to the install command
BROWSERSTACK_FORCE: << pipeline.parameters.browserstack-force >>
REACT_VERSION: << parameters.react-version >>
COREPACK_ENABLE_DOWNLOAD_PROMPT: '0'
working_directory: /tmp/mui
docker:
- image: cimg/node:20.17
Expand Down Expand Up @@ -64,24 +63,15 @@ commands:
steps:
- run:
name: Install pnpm package manager
command: |
corepack enable
- 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:
- v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
command: corepack enable
- when:
condition:
not: << parameters.browsers >>
steps:
# See https://stackoverflow.com/a/73411601
- run: corepack enable --install-directory ~/bin
- run:
name: Install pnpm package manager
# See https://stackoverflow.com/a/73411601
command: corepack enable --install-directory ~/bin

- run:
name: View install environment
Expand All @@ -107,20 +97,6 @@ commands:
name: Install @mui/material@next
command: pnpm use-material-ui-v6

- when:
condition: << parameters.browsers >>
steps:
- run:
name: Install playwright browsers
command: npx playwright install --with-deps
- save_cache:
name: Save playwright cache
key: v6-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:
<<: *default-job
Expand Down Expand Up @@ -239,8 +215,6 @@ jobs:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.44.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
- checkout
- install_js:
Expand Down Expand Up @@ -272,8 +246,6 @@ jobs:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.44.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
- checkout
- install_js:
Expand All @@ -285,8 +257,6 @@ jobs:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.44.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
- checkout
- install_js:
Expand All @@ -300,8 +270,6 @@ jobs:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.44.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
- checkout
- install_js:
Expand Down

0 comments on commit 31dde46

Please sign in to comment.