From a25d376c3deb41e39c208cad80a1898fe6af70d5 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Thu, 1 Dec 2022 13:54:14 +0100 Subject: [PATCH] chore: add provider-integration tests conditionaly for PRs and to releases --- .github/labeler.yml | 8 ++++++++ .../{integration-pr.yml => pr-integration.yml} | 0 .github/workflows/pr-provider-integration.yml | 17 +++++++++++++++++ .github/workflows/provider-integration.yml | 15 +++++++-------- .github/workflows/release.yml | 14 ++++++++++++++ .github/workflows/release_next.yml | 12 ++++++++++++ 6 files changed, 58 insertions(+), 8 deletions(-) rename .github/workflows/{integration-pr.yml => pr-integration.yml} (100%) create mode 100644 .github/workflows/pr-provider-integration.yml diff --git a/.github/labeler.yml b/.github/labeler.yml index 3aeedef3b1..2b3e7e433b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -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/**" diff --git a/.github/workflows/integration-pr.yml b/.github/workflows/pr-integration.yml similarity index 100% rename from .github/workflows/integration-pr.yml rename to .github/workflows/pr-integration.yml diff --git a/.github/workflows/pr-provider-integration.yml b/.github/workflows/pr-provider-integration.yml new file mode 100644 index 0000000000..527d58cce5 --- /dev/null +++ b/.github/workflows/pr-provider-integration.yml @@ -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 diff --git a/.github/workflows/provider-integration.yml b/.github/workflows/provider-integration.yml index 5d17799b6a..9b6bfedac5 100644 --- a/.github/workflows/provider-integration.yml +++ b/.github/workflows/provider-integration.yml @@ -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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32ebec96ca..53b1531052 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,6 +91,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: @@ -134,6 +140,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test if: needs.prepare-release.outputs.release_status == 'unreleased' container: @@ -158,6 +165,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test if: needs.prepare-release.outputs.release_status == 'unreleased' container: @@ -178,6 +186,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test if: needs.prepare-release.outputs.release_status == 'unreleased' container: @@ -199,6 +208,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test if: needs.prepare-release.outputs.release_status == 'unreleased' container: @@ -225,6 +235,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test if: needs.prepare-release.outputs.release_status == 'unreleased' container: @@ -246,6 +257,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test if: needs.prepare-release.outputs.release_status == 'unreleased' container: @@ -269,6 +281,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test if: needs.prepare-release.outputs.release_status == 'unreleased' container: @@ -325,6 +338,7 @@ jobs: needs: - examples - integration_test + - provider_integration_test - linting - prepare-release - release_github diff --git a/.github/workflows/release_next.yml b/.github/workflows/release_next.yml index c8b688e473..112da9e2b2 100644 --- a/.github/workflows/release_next.yml +++ b/.github/workflows/release_next.yml @@ -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: @@ -129,6 +135,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test runs-on: ubuntu-latest container: @@ -149,6 +156,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test runs-on: ubuntu-latest container: @@ -169,6 +177,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test runs-on: ubuntu-latest container: @@ -194,6 +203,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test runs-on: ubuntu-latest container: @@ -214,6 +224,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test runs-on: ubuntu-latest container: @@ -236,6 +247,7 @@ jobs: needs: - prepare-release - integration_test + - provider_integration_test - unit_test - release_npm runs-on: ubuntu-latest