Skip to content

Commit

Permalink
feat(cli-integ-tests): allow skipping integ tests with label (#801)
Browse files Browse the repository at this point in the history
* feat(cli-integ-tests): allow skipping using a label

Allows skipping the integ workflow if the label `pr/exempt-integ-test`
is added.

* Update src/cdk-cli-integ-tests.ts

Co-authored-by: Momo Kornher <[email protected]>

* chore: self mutation

Signed-off-by: github-actions <[email protected]>

---------

Signed-off-by: github-actions <[email protected]>
Co-authored-by: Momo Kornher <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
3 people authored Feb 20, 2025
1 parent def5bea commit 236047e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/cdk-cli-integ-tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Component, github, javascript } from 'projen';

const NOT_FLAGGED_EXPR = "!contains(github.event.pull_request.labels.*.name, 'pr/exempt-integ-test')";

export interface CdkCliIntegTestsWorkflowProps {
/**
* Runners for the workflow
Expand Down Expand Up @@ -113,7 +115,7 @@ export class CdkCliIntegTestsWorkflow extends Component {
},
// Don't run again on the merge queue, we already got confirmation that it works and the
// tests are quite expensive.
if: "github.event_name != 'merge_group'",
if: `github.event_name != 'merge_group' && ${NOT_FLAGGED_EXPR}`,
steps: [
{
name: 'Checkout',
Expand Down Expand Up @@ -215,7 +217,7 @@ export class CdkCliIntegTestsWorkflow extends Component {
},
// Don't run again on the merge queue, we already got confirmation that it works and the
// tests are quite expensive.
if: "github.event_name != 'merge_group'",
if: `github.event_name != 'merge_group' && ${NOT_FLAGGED_EXPR}`,
strategy: {
failFast: false,
matrix: {
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/cdk-cli-integ-tests.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 236047e

Please sign in to comment.