`setup-woocommerce-monorepo` Action in Highlight Changes Workflow (#42740)

This commit is contained in:
Christopher Allford 2023-12-12 21:33:52 -08:00 committed by GitHub
parent ec9b7852f9
commit be290984b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 58 deletions

View File

@ -24,12 +24,12 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: './.github/actions/setup-woocommerce-monorepo' - uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
with: with:
php-version: false # We don't want to waste time installing PHP since we aren't using it in this job. php-version: false # We don't want to waste time installing PHP since we aren't using it in this job.
name: 'Setup Monorepo'
- uses: actions/github-script@v6 - uses: actions/github-script@v6
id: 'project-matrix'
name: 'Build Matrix' name: 'Build Matrix'
id: 'project-matrix'
with: with:
script: | script: |
let baseRef = ${{ toJson( github.base_ref ) }}; let baseRef = ${{ toJson( github.base_ref ) }};
@ -56,8 +56,8 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: './.github/actions/setup-woocommerce-monorepo' - uses: './.github/actions/setup-woocommerce-monorepo'
id: 'setup-monorepo'
name: 'Setup Monorepo' name: 'Setup Monorepo'
id: 'setup-monorepo'
with: with:
install: '${{ matrix.projectName }}...' install: '${{ matrix.projectName }}...'
build: '${{ matrix.projectName }}' build: '${{ matrix.projectName }}'

View File

@ -1,40 +1,34 @@
name: Highlight templates changes name: 'Highlight Template Changes'
on: on:
pull_request: pull_request:
paths-ignore: paths:
- '**/changelog/**' - 'plugins/woocommerce/**'
permissions: {}
jobs: jobs:
analyze: analyze:
if: ${{ github.event.pull_request.user.login != 'github-actions[bot]' }} name: 'Analyze Branch Changes'
name: Check pull request changes to highlight runs-on: 'ubuntu-20.04'
runs-on: ubuntu-20.04
permissions:
contents: read
outputs: outputs:
results: ${{ steps.results.outputs.results }} results: ${{ steps.results.outputs.results }}
steps: steps:
- name: Checkout code - uses: 'actions/checkout@v3'
uses: actions/checkout@v3 name: 'Checkout'
- name: Install prerequisites - uses: './.github/actions/setup-woocommerce-monorepo'
run: | name: 'Setup WooCommerce Monorepo'
npm install -g pnpm with:
npm -g i @wordpress/env@8.0.0 install: 'code-analyzer...'
pnpm install --filter code-analyzer --filter monorepo-utils build: 'code-analyzer'
- name: Run analyzer - name: 'Analyze'
id: run id: 'analyze'
working-directory: tools/code-analyzer working-directory: 'tools/code-analyzer'
run: | run: |
HEAD_REF=$(git rev-parse HEAD) HEAD_REF=$(git rev-parse HEAD)
version=$(pnpm analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1) version=$(pnpm analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1)
pnpm analyzer "$HEAD_REF" $version -o "github" pnpm analyzer "$HEAD_REF" $version -o "github"
- name: Check results - uses: 'actions/github-script@v6'
uses: actions/github-script@v6 name: 'Validate'
with: with:
script: | script: |
const template = '${{ steps.run.outputs.templates }}'; const template = '${{ steps.analyze.outputs.templates }}';
if ( template === '' ) { if ( template === '' ) {
return; return;

View File

@ -24,6 +24,8 @@ if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) {
define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true ); define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true );
} }
// Test Change
// Load core packages and the autoloader. // Load core packages and the autoloader.
require __DIR__ . '/src/Autoloader.php'; require __DIR__ . '/src/Autoloader.php';
require __DIR__ . '/src/Packages.php'; require __DIR__ . '/src/Packages.php';