Skip to content

Commit

Permalink
feat: force fail meta-check when deps fail (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney authored Jun 17, 2024
1 parent 9ea5e37 commit adca1c0
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,27 @@
| uniq \
| sort \
| jq --raw-input --slurp --compact-output 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}
"failCheck":
"env":
"SKIP_VALIDATION": "${{ inputs.skip_validation }}"
"if": "${{ !fromJSON(inputs.skip_validation) && (cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure')) }}"
"needs":
- "checkFiles"
- "faillint"
- "golangciLint"
- "lintFiles"
- "integration"
- "testLambdaPromtail"
- "testPackages"
- "testPushPackage"
"runs-on": "ubuntu-latest"
"steps":
- "name": "checkout"
"uses": "actions/checkout@v4"
- "name": "verify checks passed"
"run": |
echo "Some checks have failed!"
exit 1,
"faillint":
"container":
"image": "${{ inputs.build_image }}"
Expand Down
24 changes: 24 additions & 0 deletions workflows/validate.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,30 @@ local validationJob = _validationJob(false);
)
),

failCheck: job.new()
+ job.withNeeds([
'checkFiles',
'faillint',
'golangciLint',
'lintFiles',
'integration',
'testLambdaPromtail',
'testPackages',
'testPushPackage',
])
+ job.withEnv({
SKIP_VALIDATION: '${{ inputs.skip_validation }}',
})
+ job.withIf("${{ !fromJSON(inputs.skip_validation) && (cancelled() || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'failure')) }}")
+ job.withSteps([
common.checkout,
step.new('verify checks passed')
+ step.withRun(|||
echo "Some checks have failed!"
exit 1,
|||),
]),

check: job.new()
+ job.withNeeds([
'checkFiles',
Expand Down

0 comments on commit adca1c0

Please sign in to comment.