CI: caching tune (part one - relocate playwright caching) (#49081)
In this PR we ar relocating playwright downloads caching into the monorepo action (behind input parameter). That consolidates monorepo-related caching and also reduces the time fetching the cache action in external workflows.
This commit is contained in:
parent
7aa42a6d76
commit
f8c95a8db8
|
@ -10,6 +10,9 @@ inputs:
|
|||
build:
|
||||
description: 'Given a boolean or PNPM filter, runs the build command for monorepo project(s).'
|
||||
default: false
|
||||
pull-playwright-cache:
|
||||
description: 'Given a boolean value, invokes Playwright dependencies caching.'
|
||||
default: false
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
|
@ -40,6 +43,13 @@ runs:
|
|||
path: '~/.cache/composer/files'
|
||||
key: "${{ runner.os }}-composer-${{ hashFiles( '**/composer.lock' ) }}"
|
||||
restore-keys: '${{ runner.os }}-composer-'
|
||||
- name: 'Cache: playwright downloads'
|
||||
if: ${{ inputs.pull-playwright-cache != 'false' }}
|
||||
uses: 'actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319'
|
||||
with:
|
||||
path: '~/.cache/ms-playwright/'
|
||||
key: "${{ runner.os }}-playwright-${{ hashFiles( '**/pnpm-lock.yaml' ) }}"
|
||||
restore-keys: '${{ runner.os }}-playwright-'
|
||||
- name: 'Parse Project Filters'
|
||||
id: 'project-filters'
|
||||
shell: 'bash'
|
||||
|
|
|
@ -119,6 +119,7 @@ jobs:
|
|||
with:
|
||||
install: '${{ matrix.projectName }}...'
|
||||
build: 'false'
|
||||
pull-playwright-cache: ${{ matrix.testEnv.shouldCreate && matrix.testType == 'e2e' }}
|
||||
|
||||
- uses: './.github/actions/setup-woocommerce-monorepo'
|
||||
if: ${{ github.ref_type != 'tag' }}
|
||||
|
@ -136,15 +137,6 @@ jobs:
|
|||
working-directory: ${{ matrix.projectPath }}
|
||||
run: node ./tests/e2e-pw/bin/override-wp-env-plugins.js
|
||||
|
||||
- name: 'Cache Playwright Downloads'
|
||||
id: 'cache-playwright-downloads'
|
||||
if: ${{ matrix.testEnv.shouldCreate }}
|
||||
uses: 'actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319'
|
||||
with:
|
||||
path: '~/.cache/ms-playwright/'
|
||||
key: "${{ runner.os }}-playwright-${{ hashFiles( '**/pnpm-lock.yaml' ) }}"
|
||||
restore-keys: '${{ runner.os }}-playwright-'
|
||||
|
||||
- name: 'Start Test Environment'
|
||||
id: 'prepare-test-environment'
|
||||
if: ${{ matrix.testEnv.shouldCreate }}
|
||||
|
|
|
@ -51,6 +51,7 @@ jobs:
|
|||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
pull-playwright-cache: true
|
||||
|
||||
- name: Install Playwright dependencies
|
||||
run: pnpm exec playwright install chromium --with-deps
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
CI: tuning deps caching for playwright.
|
Loading…
Reference in New Issue