Skip to content
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

chore: offboard checks from PRs to main #2315

Merged
merged 1 commit into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
name: Examples Integration
on:
pull_request:
paths:
# This workflow
- ".github/workflows/examples.yml"
# All packages under test
- "packages/**"
# Version changes might introduce bugs
- "package.json"
# All examples
- "examples/**"
# All scripts we use
- "tools/align-version.sh"
- "test/run-against-dist*"
- "tools/build-example.js"
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- reopened
workflow_call:
inputs:
is_workflow_call:
description: Only true if called by a workflow call, undefined otherwise
default: true
required: false
type: boolean
concurrency_group_prefix:
default: pr
required: false
type: string

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

jobs:
build-example-matrix:
if: inputs.is_workflow_call || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'ci/run-examples') || contains(github.event.pull_request.labels.*.name, 'ci/run-all')
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.set-examples.outputs.examples }}
Expand Down
27 changes: 13 additions & 14 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name: Integration Tests
on:
pull_request:
paths:
# This workflow
- ".github/workflows/integration.yml"
# All packages under test
- "packages/**"
# Version changes might introduce bugs
- "package.json"
# All integration test changes
- "test/**"
# All scripts we use
- "tools/align-version.sh"
- "tools/build-test-matrix.sh"

pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- reopened
workflow_call:
inputs:
is_workflow_call:
description: Only true if called by a workflow call, undefined otherwise
default: true
required: false
type: boolean
skip_setup:
description: Skip the version and build step and use parent
default: false
Expand All @@ -32,6 +30,7 @@ concurrency:

jobs:
prepare-integration-tests:
if: inputs.is_workflow_call || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'ci/run-integration') || contains(github.event.pull_request.labels.*.name, 'ci/run-all')
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.build-test-matrix.outputs.tests }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/provider-integration.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Provider Integration Tests
on:
push:
branches:
- main
pull_request:
paths:
- "packages/@cdktf/provider-generator/**"
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ jobs:
concurrency_group_prefix: release
secrets: inherit

examples:
needs:
- prepare-release
uses: ./.github/workflows/examples.yml
with:
concurrency_group_prefix: release
secrets: inherit

linting:
needs:
- prepare-release
Expand All @@ -98,8 +106,22 @@ jobs:
needs:
- prepare-release
uses: ./.github/workflows/unit.yml
strategy:
fail-fast: false
matrix:
package:
- cdktf
- cdktf-cli
- "@cdktf/hcl2cdk"
- "@cdktf/hcl2json"
- "@cdktf/provider-generator"
terraform_version:
- "1.1.9"
- "1.2.8"
with:
concurrency_group_prefix: release
package: ${{ matrix.package }}
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit

release_github:
Expand Down Expand Up @@ -282,3 +304,33 @@ jobs:
commit-message: cdktf ${{ steps.get_version.outputs.version }}
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_COMMITTER_TOKEN }}

report:
name: Report status
runs-on: ubuntu-latest
if: ${{ failure() }}
needs:
- examples
- integration_test
- linting
- prepare-release
- release_github
- release_golang
- release_homebrew
- release_maven
- release_npm
- release_nuget
- release_pypi
- release_sentry
- unit_test
steps:
- name: Send failures to Slack
uses: slackapi/slack-github-action@v1.21.0
with:
payload: |
{
"provider_name": "CDKTF",
"run_url": "https://github.com/hashicorp/cdktf/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.FAILURE_SLACK_WEBHOOK_URL }
50 changes: 50 additions & 0 deletions .github/workflows/release_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,22 @@ jobs:
needs:
- prepare-release
uses: ./.github/workflows/unit.yml
strategy:
fail-fast: false
matrix:
package:
- cdktf
- cdktf-cli
- "@cdktf/hcl2cdk"
- "@cdktf/hcl2json"
- "@cdktf/provider-generator"
terraform_version:
- "1.1.9"
- "1.2.8"
with:
concurrency_group_prefix: release-next
package: ${{ matrix.package }}
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit

linting:
Expand All @@ -108,6 +122,14 @@ jobs:
concurrency_group_prefix: release-next
secrets: inherit

examples:
needs:
- prepare-release
uses: ./.github/workflows/examples.yml
with:
concurrency_group_prefix: release-next
secrets: inherit

release_npm:
name: Release to NPM
needs:
Expand Down Expand Up @@ -244,3 +266,31 @@ jobs:
run: sentry-cli releases finalize cdktf-cli-${{ steps.get_version.outputs.version }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_TOKEN }}

report:
name: Report status
runs-on: ubuntu-latest
if: ${{ failure() }}
needs:
- examples
- integration_test
- linting
- prepare-release
- release_golang
- release_maven
- release_npm
- release_nuget
- release_pypi
- release_sentry
- unit_test
steps:
- name: Send failures to Slack
uses: slackapi/slack-github-action@v1.21.0
with:
payload: |
{
"provider_name": "CDKTF(next)",
"run_url": "https://github.com/hashicorp/terraform-cdk/actions/runs/${{ github.run_id }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.FAILURE_SLACK_WEBHOOK_URL }
27 changes: 27 additions & 0 deletions .github/workflows/unit-@cdktf-hcl2cdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit Tests - @cdktf/hcl2cdk
on:
pull_request:
paths:
# This workflow
- ".github/workflows/unit-@cdktf-hcl2cdk.yml"
# All packages under test
- "packages/@cdktf/hcl2cdk/**"
# All scripts we use
- "tools/build-unit-test-matrix.sh"
- "tools/align-version.sh"

jobs:
unit_test:
needs:
- prepare-release
uses: ./.github/workflows/unit.yml
strategy:
fail-fast: false
matrix:
terraform_version:
- "1.2.8"
with:
concurrency_group_prefix: release
package: "@cdktf/hcl2cdk"
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit
27 changes: 27 additions & 0 deletions .github/workflows/unit-@cdktf-hcl2json.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit Tests - @cdktf/hcl2json
on:
pull_request:
paths:
# This workflow
- ".github/workflows/unit-@cdktf-hcl2json.yml"
# All packages under test
- "packages/@cdktf/hcl2json/**"
# All scripts we use
- "tools/build-unit-test-matrix.sh"
- "tools/align-version.sh"

jobs:
unit_test:
needs:
- prepare-release
uses: ./.github/workflows/unit.yml
strategy:
fail-fast: false
matrix:
terraform_version:
- "1.2.8"
with:
concurrency_group_prefix: release
package: "@cdktf/hcl2json"
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit
27 changes: 27 additions & 0 deletions .github/workflows/unit-@cdktf-provider-generator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit Tests - @cdktf/provider-generator
on:
pull_request:
paths:
# This workflow
- ".github/workflows/unit-@cdktf-provider-gener@cdktf/provider-generator.yml"
# All packages under test
- "packages/@cdktf/provider-generator/**"
# All scripts we use
- "tools/build-unit-test-matrix.sh"
- "tools/align-version.sh"

jobs:
unit_test:
needs:
- prepare-release
uses: ./.github/workflows/unit.yml
strategy:
fail-fast: false
matrix:
terraform_version:
- "1.2.8"
with:
concurrency_group_prefix: release
package: "@cdktf/provider-generator"
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/unit-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Unit Tests - cdktf
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- reopened

jobs:
unit_test:
if: contains(github.event.pull_request.labels.*.name, 'ci/run-unit') || contains(github.event.pull_request.labels.*.name, 'ci/run-all')
uses: ./.github/workflows/unit.yml
strategy:
fail-fast: false
matrix:
package:
- cdktf
- cdktf-cli
- "@cdktf/hcl2cdk"
- "@cdktf/hcl2json"
- "@cdktf/provider-generator"
terraform_version:
- "1.1.9"
- "1.2.8"
with:
concurrency_group_prefix: unit-all
package: ${{ matrix.package }}
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit
27 changes: 27 additions & 0 deletions .github/workflows/unit-cdktf-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit Tests - cdktf-cli
on:
pull_request:
paths:
# This workflow
- ".github/workflows/unit-cdktf-cli.yml"
# All packages under test
- "packages/cdktf-cli/**"
# All scripts we use
- "tools/build-unit-test-matrix.sh"
- "tools/align-version.sh"

jobs:
unit_test:
needs:
- prepare-release
uses: ./.github/workflows/unit.yml
strategy:
fail-fast: false
matrix:
terraform_version:
- "1.2.8"
with:
concurrency_group_prefix: release
package: "cdktf-cli"
terraform_version: ${{ matrix.terraform_version }}
secrets: inherit
Loading