CI: caching tweaks in GitHub actions (#48865)

* Tooling: cache pnp deps

* Tooling: try fixing cache errors

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: try to parallelize js builds a bit

* Tooling: added pre-build steps to solve concurrency issues

* Tooling: limit workers

* Tooling: revert to original build command

* Tooling: playwright related tweaks

* Tooling: minor tweaks.

* Tooling: fix caching path.

* Tooling: trigger php builds to test deps caching.

* Tooling: trigger php builds to test deps caching.

* Tooling: lock caching to monorepo setup, so it doesn't slow down build steps.

* Tooling: lock Playwright cache to build, as build is pre-requisite for running tests.

* Tooling: added caching build-folders.

* Tooling: added caching build-folders.

* Tooling: added caching build-folders.

* Revert "Tooling: added caching build-folders."

This reverts commit c57b9dff13.

* Tooling: added caching build-folders.

* Tooling: cleanup sweep.

* Tooling: cleanup sweep.

* Tooling: added a changelog entry.

* Tooling: cleanup.

* Tooling: try speedup live branches build.

* Tooling: try speedup live branches build.

* Tooling: cleanup.

* Tooling: try speedup live branches build.

* Tooling: try speedup live branches build.
This commit is contained in:
Vladimir Reznichenko 2024-06-28 15:50:32 +02:00 committed by GitHub
parent 67de31b823
commit 6b121e2f34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 3 deletions

View File

@ -34,7 +34,7 @@ runs:
php-version: '${{ inputs.php-version }}'
coverage: 'none'
- name: 'Cache Composer Dependencies'
if: ${{ inputs.php-version != 'false' }}
if: ${{ inputs.build == 'false' }}
uses: 'actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319'
with:
path: '~/.cache/composer/files'

View File

@ -31,6 +31,12 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
- name: Cache PNPM Dependencies
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version-file: .nvmrc
cache: pnpm
- name: Prepare plugin zips
id: prepare
env:
@ -52,7 +58,7 @@ jobs:
mkdir "$GITHUB_WORKSPACE/zips"
cp "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
cd "$GITHUB_WORKSPACE/zips"
unzip woocommerce.zip
unzip -qq woocommerce.zip
rm woocommerce.zip
mv woocommerce woocommerce-dev
zip -q -r "woocommerce-dev.zip" "woocommerce-dev/"

View File

@ -135,6 +135,15 @@ jobs:
ARTIFACT_NAME: ${{ github.ref_name == 'nightly' && 'woocommerce-trunk-nightly.zip' || 'woocommerce.zip' }}
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'

View File

@ -40,6 +40,12 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
- name: Cache PNPM Dependencies
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version-file: .nvmrc
cache: pnpm
- name: Prepare plugin zips
id: prepare
env:
@ -62,7 +68,7 @@ jobs:
mkdir -p "$GITHUB_WORKSPACE/unzips/woocommerce"
cp "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
cd "$GITHUB_WORKSPACE/zips"
unzip woocommerce.zip
unzip -qq woocommerce.zip
cp -r woocommerce "$GITHUB_WORKSPACE/unzips/woocommerce/woocommerce"
rm woocommerce.zip
mv woocommerce woocommerce-dev

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Tweaks related to caching Composer dependecies and Playwright downloads in CI.