Skip to content

Commit

Permalink
fix: Use an additional results step to ensure dynamic matrix jobs can… (
Browse files Browse the repository at this point in the history
#3288)

… be used

<!--

Unless this is a very simple 1-line-of-code change, please create a new
issue describing the change you're proposing first, then link to it from
this PR.

Read more about our process in our contributing guide:
https://github.com/hashicorp/terraform-cdk/blob/main/CONTRIBUTING.md

-->

### Description

Branch protections, RuleSets and so on within Github don't seem to work
that well with dynamic (matrix based) jobs, so following the suggestions
of https://github.com/orgs/community/discussions/26822 to see if we can
use them.
  • Loading branch information
mutahhir authored Nov 23, 2023
1 parent 5f1735c commit 67620a1
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/examples-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ jobs:
with:
concurrency_group_prefix: pr
secrets: inherit
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Result
needs: [examples]
steps:
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}
12 changes: 12 additions & 0 deletions .github/workflows/pr-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ jobs:
with:
concurrency_group_prefix: pr
secrets: inherit
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Result
needs: [integration_test]
steps:
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}
12 changes: 12 additions & 0 deletions .github/workflows/pr-provider-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ jobs:
with:
concurrency_group_prefix: pr
secrets: inherit
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Result
needs: [provider_integration_test]
steps:
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}
13 changes: 13 additions & 0 deletions .github/workflows/pr-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,16 @@ jobs:
package: "cdktf"
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit

results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Result
needs: [all_unit_tests]
steps:
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}

0 comments on commit 67620a1

Please sign in to comment.