Skip to content

Commit

Permalink
chore: add provider-integration tests conditionaly for PRs and to rel…
Browse files Browse the repository at this point in the history
…eases
  • Loading branch information
DanielMSchmidt committed Dec 1, 2022
1 parent 3acb935 commit cbfae82
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ ci/run-examples:
- ".github/workflows/unit.yml"
# The examples
- "examples/**"

ci/provider-integration:
# The workflow used
- ".github/workflows/provider-integration.yml"
# The provider generator
- "packages/@cdktf/provider-generator/**"
# The tests
- "test/provider-tests/**"
File renamed without changes.
17 changes: 17 additions & 0 deletions .github/workflows/pr-provider-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Provider Integration Tests - PR
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- reopened

jobs:
provider_integration_test:
if: ${{ contains(github.event.pull_request.labels.*.name, ci/provider-integration') || contains(github.event.pull_request.labels.*.name, 'ci/run-all') }}
uses: ./.github/workflows/provider-integration.yml
with:
concurrency_group_prefix: pr
secrets: inherit
15 changes: 7 additions & 8 deletions .github/workflows/provider-integration.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: Provider Integration Tests
on:
push:
branches:
- main
pull_request:
paths:
- "packages/@cdktf/provider-generator/**"
- "test/provider-tests/**"
workflow_call:
inputs:
concurrency_group_prefix:
default: pr
required: false
type: string

concurrency:
group: provider-${{ github.head_ref }}
group: ${{ inputs.concurrency_group_prefix }}-provider-integration-${{ github.head_ref }}
cancel-in-progress: true

jobs:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ jobs:
concurrency_group_prefix: release
secrets: inherit

provider_integration_test:
uses: ./.github/workflows/provider-integration.yml
with:
concurrency_group_prefix: release
secrets: inherit

examples:
uses: ./.github/workflows/examples.yml
with:
Expand Down Expand Up @@ -131,6 +137,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
container:
Expand All @@ -154,6 +161,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
if: jobs.prepare-release.outputs.release_status == 'unreleased'
Expand All @@ -174,6 +182,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
if: jobs.prepare-release.outputs.release_status == 'unreleased'
Expand All @@ -195,6 +204,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
if: jobs.prepare-release.outputs.release_status == 'unreleased'
Expand All @@ -221,6 +231,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
if: jobs.prepare-release.outputs.release_status == 'unreleased'
Expand All @@ -242,6 +253,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
if: jobs.prepare-release.outputs.release_status == 'unreleased'
Expand All @@ -265,6 +277,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
if: jobs.prepare-release.outputs.release_status == 'unreleased'
Expand Down Expand Up @@ -320,6 +333,7 @@ jobs:
needs:
- examples
- integration_test
- provider_integration_test
- linting
- prepare-release
- release_github
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ jobs:
concurrency_group_prefix: release-next
secrets: inherit

provider_integration_test:
uses: ./.github/workflows/provider-integration.yml
with:
concurrency_group_prefix: release-next
secrets: inherit

examples:
uses: ./.github/workflows/examples.yml
with:
Expand All @@ -129,6 +135,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
container:
Expand All @@ -149,6 +156,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
container:
Expand All @@ -169,6 +177,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
container:
Expand All @@ -194,6 +203,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
container:
Expand All @@ -214,6 +224,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
runs-on: ubuntu-latest
container:
Expand All @@ -236,6 +247,7 @@ jobs:
needs:
- prepare-release
- integration_test
- provider_integration_test
- unit_test
- release_npm
runs-on: ubuntu-latest
Expand Down

0 comments on commit cbfae82

Please sign in to comment.