-
Notifications
You must be signed in to change notification settings - Fork 459
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
ci: disable stages if only docs changes or .github #2877
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,9 +41,16 @@ pipeline { | |
deleteDir() | ||
gitCheckout(basedir: "${BASE_DIR}") | ||
stashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}") | ||
dir("${BASE_DIR}"){ | ||
// Skip all the stages except check Go sources for changeset's with asciidoc, md or .github changes only | ||
setEnvVar('ONLY_DOCS', isGitRegionMatch(patterns: [ '(.*\\.(asciidoc|md)|^\\.github/.*)' ], shouldMatchAll: true).toString()) | ||
} | ||
} | ||
} | ||
stage('Check Go sources') { | ||
when { | ||
expression { return env.ONLY_DOCS == "false" } | ||
} | ||
steps { | ||
dir("${BASE_DIR}"){ | ||
withMageEnv(){ | ||
|
@@ -54,6 +61,9 @@ pipeline { | |
} | ||
} | ||
stage('Check integrations') { | ||
when { | ||
expression { return env.ONLY_DOCS == "false" } | ||
} | ||
Comment on lines
+61
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Packages have generated content in their Maybe instead of having the condition here for the whole stage, it could be after the |
||
steps { | ||
script { | ||
dir("${BASE_DIR}/packages") { | ||
|
@@ -115,7 +125,9 @@ pipeline { | |
} | ||
post { | ||
always { | ||
publishCoverageReports() | ||
whenTrue(env.ONLY_DOCS == "false") { | ||
publishCoverageReports() | ||
} | ||
} | ||
cleanup { | ||
notifyBuildResult(prComment: true) | ||
|
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.
We want to run
mage check
if.github/CODEOWNERS
change (see #2768). If this is a problem we could extract this to a different target that is always run, thoughmage check
is fast now.