Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ jobs:
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.global-cache-dir-path.outputs.terraform }}
key: terraform-${{ runner.os }}-${{ matrix.terraform }}-examples
key: terraform-${{ runner.os }}-${{ matrix.binary }}-examples
restore-keys: |
terraform-${{ runner.os }}-${{ matrix.terraform }}
terraform-${{ runner.os }}-${{ matrix.binary }}
- name: Cache go
# Only Go examples and the cross-language `*-documentation` examples need GOCACHE
if: startsWith(matrix.target, '@examples/go') || endsWith(matrix.target, '-documentation')
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
TEST_TARGET: "${{ matrix.target }}"
TERRAFORM_BINARY_NAME: "terraform${{ matrix.terraform }}"
TERRAFORM_BINARY_NAME: ${{ matrix.binary }}
MAVEN_OPTS: "-Xmx3G"
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.terraform }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pr-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ jobs:
strategy:
fail-fast: false
matrix:
terraform_version: ["1.16.1", "1.5.7"]
include:
- terraform_version: "1.16.1"
terraform_binary: terraform1.16.1
- terraform_version: "1.5.7"
terraform_binary: terraform1.5.7
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
Expand Down Expand Up @@ -170,7 +174,7 @@ jobs:
--coverage \
--reporters=default --reporters=github-actions
env:
TERRAFORM_BINARY_NAME: "terraform${{ matrix.terraform_version }}"
TERRAFORM_BINARY_NAME: ${{ matrix.terraform_binary }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
CDKTF_EXPERIMENTAL_PROVIDER_SCHEMA_CACHE_PATH: ${{ steps.global-cache-dir-path.outputs.providerSchema }}

Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/provider-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
default: 1.16.1
type: string
required: false
terraform_binary:
description: Version-suffixed CLI in the image; must correspond to terraform_version
default: terraform1.16.1
type: string
required: false
dist_artifact_name:
description: Name of the dist artifact created
default: dist-provider-integration
Expand Down Expand Up @@ -99,7 +104,7 @@ jobs:
env:
CHECKPOINT_DISABLE: "1"
TERRAFORM_VERSION: ${{ inputs.terraform_version }}
TERRAFORM_BINARY_NAME: "terraform${{ inputs.terraform_version }}"
TERRAFORM_BINARY_NAME: ${{ inputs.terraform_binary }}
timeout-minutes: 60

steps:
Expand Down Expand Up @@ -127,9 +132,9 @@ jobs:
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.global-cache-dir-path.outputs.terraform }}
key: terraform-${{ runner.os }}-${{ inputs.terraform_version }}-provider-integration
key: terraform-${{ runner.os }}-${{ inputs.terraform_binary }}-provider-integration
restore-keys: |
terraform-${{ runner.os }}-${{ inputs.terraform_version }}-
terraform-${{ runner.os }}-${{ inputs.terraform_binary }}-
- name: install test dependencies
run: cd test && pnpm ci
- name: integration tests
Expand Down Expand Up @@ -180,9 +185,9 @@ jobs:
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.global-cache-dir-path.outputs.terraform }}
key: terraform-${{ runner.os }}-${{ inputs.terraform_version }}-provider-integration
key: terraform-${{ runner.os }}-${{ inputs.terraform_binary }}-provider-integration
restore-keys: |
terraform-${{ runner.os }}-${{ inputs.terraform_version }}-
terraform-${{ runner.os }}-${{ inputs.terraform_binary }}-
# tmp fix for https://github.com/npm/cli/issues/4980
- name: update npm
run: npm install -g npm@8.12.1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ jobs:
"@cdktn/commons",
"@cdktn/cli-core",
]
terraform_version: ["1.16.1", "1.5.7"]
terraform_binary: [terraform1.16.1, terraform1.5.7]
with:
concurrency_group_prefix: release
package: ${{ matrix.package }}
terraform_version: ${{ matrix.terraform_version }}
terraform_binary: ${{ matrix.terraform_binary }}
secrets: inherit

# ---------------------------------------------------------------------------
Expand All @@ -270,11 +270,11 @@ jobs:
"@cdktn/commons",
"@cdktn/cli-core",
]
terraform_version: ["1.16.1", "1.5.7"]
terraform_binary: [terraform1.16.1, terraform1.5.7]
with:
concurrency_group_prefix: release-next
package: ${{ matrix.package }}
terraform_version: ${{ matrix.terraform_version }}
terraform_binary: ${{ matrix.terraform_binary }}
secrets: inherit

quality_next:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ on:
package:
required: true
type: string
terraform_version:
terraform_binary:
description: Version-suffixed CLI in the image, e.g. terraform1.16.1 or tofu1.12.6
required: true
type: string

env:
HUSKY: "0"

concurrency:
group: ${{ inputs.concurrency_group_prefix }}-unit-${{ inputs.package }}-${{ inputs.terraform_version }}-${{ github.head_ref }}
group: ${{ inputs.concurrency_group_prefix }}-unit-${{ inputs.package }}-${{ inputs.terraform_binary }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -58,7 +59,7 @@ jobs:
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.global-cache-dir-path.outputs.providerSchema }}
key: providerSchema-${{ runner.os }}-${{ inputs.terraform_version }}-unit-${{ inputs.package }}
key: providerSchema-${{ runner.os }}-${{ inputs.terraform_binary }}-unit-${{ inputs.package }}

- name: installing dependencies
run: |
Expand All @@ -77,7 +78,7 @@ jobs:
unset TF_PLUGIN_CACHE_DIR
pnpm exec nx test '${{ inputs.package }}' --ci --coverage --reporters=default --reporters=github-actions
env:
TERRAFORM_BINARY_NAME: "terraform${{ inputs.terraform_version }}"
TERRAFORM_BINARY_NAME: ${{ inputs.terraform_binary }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
CDKTF_EXPERIMENTAL_PROVIDER_SCHEMA_CACHE_PATH: ${{ steps.global-cache-dir-path.outputs.providerSchema }}

Expand Down
5 changes: 4 additions & 1 deletion tools/build-example-matrix.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,20 @@ if (missingHclSmoke.length > 0) {
* @type {{
* target: string[],
* terraform: string[],
* binary: string[],
* hclOutput: boolean[],
* include: Array<{ target: string, terraform: string, hclOutput: boolean }>,
* include: Array<{ target: string, terraform: string, binary: string, hclOutput: boolean }>,
* }}
*/
const matrix = {
target: targets,
terraform: [tfDefault],
binary: [`terraform${tfDefault}`],
hclOutput: [false],
include: hclSmokeTargets.map((target) => ({
target,
terraform: tfDefault,
binary: `terraform${tfDefault}`,
hclOutput: true,
})),
};
Expand Down
Loading