CI: missing jobs on changes in components package. (#49330)

This PR addresses issues in building a CI jobs matrix (resolving dependent packages and running CI jobs for them).
This commit is contained in:
Vladimir Reznichenko 2024-07-11 14:36:56 +02:00 committed by GitHub
parent e049d93681
commit 9fef18cd0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 20 deletions

View File

@ -87,7 +87,6 @@
"test:e2e:block-theme": "pnpm run test:e2e block_theme", "test:e2e:block-theme": "pnpm run test:e2e block_theme",
"test:e2e:classic-theme": "pnpm run test:e2e classic_theme", "test:e2e:classic-theme": "pnpm run test:e2e classic_theme",
"test:e2e:block-theme-with-templates": "pnpm run test:e2e block_theme_with_templates", "test:e2e:block-theme-with-templates": "pnpm run test:e2e block_theme_with_templates",
"test:e2e:fake": "echo 'It should trigger Blocks e2e tests in @woocommerce/plugin-woocommerce'",
"test:e2e:jest": "pnpm run wp-env:config && cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config.js NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js", "test:e2e:jest": "pnpm run wp-env:config && cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config.js NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js",
"test:e2e:jest:dev": "pnpm run wp-env:config && cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config-dev.js NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js", "test:e2e:jest:dev": "pnpm run wp-env:config && cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config-dev.js NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js",
"test:e2e:jest:dev-watch": "pnpm run wp-env:config && cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config-dev.js NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js --watch", "test:e2e:jest:dev-watch": "pnpm run wp-env:config && cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config-dev.js NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js --watch",
@ -373,17 +372,6 @@
"pull_request", "pull_request",
"push" "push"
] ]
},
{
"name": "Blocks e2e - trigger for Blocks e2e tests in @woocommerce/plugin-woocommerce",
"testType": "e2e",
"command": "test:e2e:fake",
"changes": [
"tests/e2e/**"
],
"events": [
"pull_request"
]
} }
] ]
} }

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
CI: cleanup CI related command after fixing jobs matrix generation.

File diff suppressed because one or more lines are too long

View File

@ -302,13 +302,14 @@ async function createJobsForProject(
dependencyCascade dependencyCascade
); );
if ( if ( dependencyChanges === false ) {
dependencyChanges === false && // First line of detection: implicit changes list points to the dependency.
Object.values( dependencyJobs ).some( dependencyChanges = ( changes[ dependency.name ] || [] ).length > 0;
( array ) => array.length > 0 if ( dependencyChanges === false ) {
) // Second line of detection: the dependency spawns jobs.
) { dependencyChanges =
dependencyChanges = true; dependencyJobs.test.length + dependencyJobs.lint.length > 0;
}
} }
newJobs.lint.push( ...dependencyJobs.lint ); newJobs.lint.push( ...dependencyJobs.lint );