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

[code-infra] Remove custom playwright installation steps #250

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
47 changes: 12 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ 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 >>
TEST_GATE: << parameters.test-gate >>
AWS_REGION_ARTIFACTS: eu-central-1
COREPACK_ENABLE_DOWNLOAD_PROMPT: '0'
working_directory: /tmp/material-ui
docker:
- image: cimg/node:18.19
Expand All @@ -69,34 +68,27 @@ commands:
description: 'Set to true if you intend to any browser (for example with playwright).'

steps:
- run:
name: Resolve React version
command: |
node scripts/useReactVersion.mjs
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD
- when:
condition: << parameters.browsers >>
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" }}
- 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: Resolve React version
command: |
node scripts/useReactVersion.mjs
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD

- run:
name: View install environment
Expand All @@ -106,19 +98,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: 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:
Expand Down Expand Up @@ -308,8 +287,6 @@ jobs:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.43.0-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
- checkout
- install_js:
Expand Down
Loading