-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Update workflow to use latest checkout actions #45199
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
65e87c0
Update workflow to use latest checkout actions
64a59eb
Update non-HPOS workflow as well
58f3390
Update additional actions
68110a3
Set a slow test threshold at 30 seconds (15 is default)
4d830d5
Final action updates
0a90afb
Slow tests has to be an object
f284da6
Pin external actions to commit
bbcc650
Slow test threshold and max
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
name: 'Setup WooCommerce Monorepo' | ||
description: 'A composite action bundling together the setup of dependencies and optional installation and building of projects.' | ||
inputs: | ||
php-version: | ||
description: 'The PHP version that should be installed. Use "false" to skip PHP installation.' | ||
default: '7.4' | ||
install: | ||
description: 'Given a boolean or PNPM filter, runs the install command for monorepo project(s).' | ||
default: false | ||
build: | ||
description: 'Given a boolean or PNPM filter, runs the build command for monorepo project(s).' | ||
default: false | ||
php-version: | ||
description: 'The PHP version that should be installed. Use "false" to skip PHP installation.' | ||
default: '7.4' | ||
install: | ||
description: 'Given a boolean or PNPM filter, runs the install command for monorepo project(s).' | ||
default: false | ||
build: | ||
description: 'Given a boolean or PNPM filter, runs the build command for monorepo project(s).' | ||
default: false | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: 'Read PNPM Version' | ||
id: 'read-pnpm-version' | ||
shell: 'bash' | ||
run: 'echo "version=$(./.github/actions/setup-woocommerce-monorepo/scripts/read-pnpm-version.sh package.json)" >> $GITHUB_OUTPUT' | ||
- name: 'Setup PNPM' | ||
uses: 'pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598' | ||
with: | ||
version: ${{ steps.read-pnpm-version.outputs.version }} | ||
- name: 'Setup Node' | ||
uses: 'actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65' | ||
with: | ||
node-version-file: '.nvmrc' | ||
# We only want to use the cache if something is being installed. | ||
cache: ${{ inputs.install != 'false' && 'pnpm' || '' }} | ||
- name: 'Setup PHP' | ||
if: ${{ inputs.php-version != 'false' }} | ||
uses: 'shivammathur/setup-php@a36e1e52ff4a1c9e9c9be31551ee4712a6cb6bd0' | ||
with: | ||
php-version: '${{ inputs.php-version }}' | ||
coverage: 'none' | ||
- name: 'Cache Composer Dependencies' | ||
if: ${{ inputs.php-version != 'false' }} | ||
uses: 'actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84' | ||
with: | ||
path: '~/.cache/composer/files' | ||
key: "${{ runner.os }}-composer-${{ hashFiles( '**/composer.lock' ) }}" | ||
restore-keys: '${{ runner.os }}-composer-' | ||
- name: 'Parse Project Filters' | ||
id: 'project-filters' | ||
shell: 'bash' | ||
run: | | ||
echo "install=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.install }}')" >> $GITHUB_OUTPUT | ||
echo "build=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.build }}')" >> $GITHUB_OUTPUT | ||
- name: 'Install Project Dependencies' | ||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. | ||
if: ${{ inputs.install == 'true' || steps.project-filters.outputs.install != '' }} | ||
shell: 'bash' | ||
run: 'pnpm install' | ||
# `pnpm install` filtering is broken: https://github.com/pnpm/pnpm/issues/6300 | ||
# run: 'pnpm install ${{ steps.project-filters.outputs.install }}' | ||
# We want to include an option to build projects using this action so that we can make | ||
# sure that the build cache is always used when building projects. | ||
- name: 'Cache Build Output' | ||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. | ||
if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }} | ||
uses: 'google/wireit@f3a3c79c553122e2fe5829eeac7d815326502903' | ||
- name: 'Build' | ||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. | ||
if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }} | ||
shell: 'bash' | ||
run: 'pnpm ${{ steps.project-filters.outputs.build }} build' | ||
using: 'composite' | ||
steps: | ||
- name: 'Read PNPM Version' | ||
id: 'read-pnpm-version' | ||
shell: 'bash' | ||
run: 'echo "version=$(./.github/actions/setup-woocommerce-monorepo/scripts/read-pnpm-version.sh package.json)" >> $GITHUB_OUTPUT' | ||
- name: 'Setup PNPM' | ||
uses: 'pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d' | ||
with: | ||
version: ${{ steps.read-pnpm-version.outputs.version }} | ||
- name: 'Setup Node' | ||
uses: 'actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65' | ||
with: | ||
node-version-file: '.nvmrc' | ||
# We only want to use the cache if something is being installed. | ||
cache: ${{ inputs.install != 'false' && 'pnpm' || '' }} | ||
- name: 'Setup PHP' | ||
if: ${{ inputs.php-version != 'false' }} | ||
uses: 'shivammathur/setup-php@a36e1e52ff4a1c9e9c9be31551ee4712a6cb6bd0' | ||
with: | ||
php-version: '${{ inputs.php-version }}' | ||
coverage: 'none' | ||
- name: 'Cache Composer Dependencies' | ||
if: ${{ inputs.php-version != 'false' }} | ||
uses: 'actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319' | ||
with: | ||
path: '~/.cache/composer/files' | ||
key: "${{ runner.os }}-composer-${{ hashFiles( '**/composer.lock' ) }}" | ||
restore-keys: '${{ runner.os }}-composer-' | ||
- name: 'Parse Project Filters' | ||
id: 'project-filters' | ||
shell: 'bash' | ||
run: | | ||
echo "install=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.install }}')" >> $GITHUB_OUTPUT | ||
echo "build=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.build }}')" >> $GITHUB_OUTPUT | ||
- name: 'Install Project Dependencies' | ||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. | ||
if: ${{ inputs.install == 'true' || steps.project-filters.outputs.install != '' }} | ||
shell: 'bash' | ||
run: 'pnpm install' | ||
# `pnpm install` filtering is broken: https://github.com/pnpm/pnpm/issues/6300 | ||
# run: 'pnpm install ${{ steps.project-filters.outputs.install }}' | ||
# We want to include an option to build projects using this action so that we can make | ||
# sure that the build cache is always used when building projects. | ||
- name: 'Cache Build Output' | ||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. | ||
if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }} | ||
uses: 'google/wireit@4aad131006ea85c1e42af927534ebb13426dd730' | ||
- name: 'Build' | ||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. | ||
if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }} | ||
shell: 'bash' | ||
run: 'pnpm ${{ steps.project-filters.outputs.build }} build' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Updates the PR testing workflow to use checkout v4 to eliminate GH node 16 warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I picked some somewhat arbitrary numbers here, we can adjust. What this says is that a test will be reported as slow if it takes longer than 30 seconds. The max number is that it's reporting the 5 slowest tests per shard... having a list of more than 25 tests probably isn't super productive.