From f52ceb64cd7145ede8900baba10ff4ee83579b17 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sat, 18 Mar 2023 12:05:48 -0700 Subject: [PATCH 01/28] Implement testing --- .github/workflows/CICD.yml | 59 ++++++++++++++++++++++++++++++++++ main.tf | 9 +++--- outputs.tf | 2 +- tests/fail/.terraform.lock.hcl | 22 +++++++++++++ tests/fail/main.tf | 5 +++ tests/pass/.terraform.lock.hcl | 22 +++++++++++++ tests/pass/main.tf | 5 +++ versions.tf | 6 ++-- 8 files changed, 121 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/CICD.yml create mode 100644 tests/fail/.terraform.lock.hcl create mode 100644 tests/fail/main.tf create mode 100644 tests/pass/.terraform.lock.hcl create mode 100644 tests/pass/main.tf diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml new file mode 100644 index 0000000..8476874 --- /dev/null +++ b/.github/workflows/CICD.yml @@ -0,0 +1,59 @@ +name: "Build" + +on: [push, pull_request] + +jobs: + Matrix: + runs-on: ubuntu-latest + + steps: + - name: Generate Matrix + id: matrix + uses: Invicton-Labs/terraform-module-testing/matrix@main + with: + minimum_tf_version: '0.13.0' + + - name: Output Matrix + run: | + echo "Strategy: ${{ steps.matrix.outputs.strategy }}" + + outputs: + strategy: ${{ steps.matrix.outputs.strategy }} + + Test: + needs: [Matrix] + strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} + runs-on: ${{ matrix.runs-on }} + container: ${{ matrix.container }} + steps: + - name: Initialize - Pass + id: init + uses: Invicton-Labs/terraform-module-testing/initialize@dev + with: + testing_path: tests/pass + - name: Run Tests - Pass + id: tests + uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev + with: + testing_path: tests/pass + + - name: Initialize - Fail + id: init + uses: Invicton-Labs/terraform-module-testing/initialize@dev + with: + testing_path: tests/fail + - name: Run Tests - Fail + id: tests + uses: Invicton-Labs/terraform-module-testing/apply-failure@dev + with: + testing_path: tests/fail + + # This job just waits for all other jobs to pass. We have it here + # so our branch protection rule can reference a single job, instead + # of needing to list every matrix value of every job above. + Passed: + runs-on: ubuntu-latest + needs: [Test] + steps: + - name: Mark tests as passed + run: echo "🎉" \ No newline at end of file diff --git a/main.tf b/main.tf index 8373e4d..a019ad6 100644 --- a/main.tf +++ b/main.tf @@ -3,12 +3,11 @@ // Therefore, unless the "checked" output parameter was actually used somewhere in the parent module, // the assertion check would never actually run. By putting it in a data source, it will always run // regardless of whether any outputs of this module are used in the parent module. The `null` data -// source would be ideal, but it throws a deprecation warning. This template data source is the +// source would be ideal, but it throws a deprecation warning. This CloudInit data source is the // next best alternative, since it is fast and doesn't interact with the operating system at all -// (unlike an external data source, for example). -data "template_file" "check" { - template = "" - vars = { +// (unlike an external data source, for example), and isn't deprecated. +data "cloudinit_config" "check" { + part { content = var.condition ? "" : SEE_ABOVE_ERROR_MESSAGE(true ? null : "ERROR: ${var.error_message}") } } diff --git a/outputs.tf b/outputs.tf index 0b93c50..d2bce0e 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,4 +1,4 @@ output "checked" { description = "Whether the condition has been checked (used for assertion dependencies)." - value = data.template_file.check.rendered == "" ? true : true + value = data.cloudinit_config.check.rendered == "" ? true : true } diff --git a/tests/fail/.terraform.lock.hcl b/tests/fail/.terraform.lock.hcl new file mode 100644 index 0000000..db7a7c3 --- /dev/null +++ b/tests/fail/.terraform.lock.hcl @@ -0,0 +1,22 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/cloudinit" { + version = "2.3.2" + constraints = ">= 2.3.1" + hashes = [ + "h1:2jb+BfT5T96dXxUD2LQ6MtVHpXErd7ZybmMvdWE2jd4=", + "zh:2487e498736ed90f53de8f66fe2b8c05665b9f8ff1506f751c5ee227c7f457d1", + "zh:3d8627d142942336cf65eea6eb6403692f47e9072ff3fa11c3f774a3b93130b3", + "zh:434b643054aeafb5df28d5529b72acc20c6f5ded24decad73b98657af2b53f4f", + "zh:436aa6c2b07d82aa6a9dd746a3e3a627f72787c27c80552ceda6dc52d01f4b6f", + "zh:458274c5aabe65ef4dbd61d43ce759287788e35a2da004e796373f88edcaa422", + "zh:54bc70fa6fb7da33292ae4d9ceef5398d637c7373e729ed4fce59bd7b8d67372", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:893ba267e18749c1a956b69be569f0d7bc043a49c3a0eb4d0d09a8e8b2ca3136", + "zh:95493b7517bce116f75cdd4c63b7c82a9d0d48ec2ef2f5eb836d262ef96d0aa7", + "zh:9ae21ab393be52e3e84e5cce0ef20e690d21f6c10ade7d9d9d22b39851bfeddc", + "zh:cc3b01ac2472e6d59358d54d5e4945032efbc8008739a6d4946ca1b621a16040", + "zh:f23bfe9758f06a1ec10ea3a81c9deedf3a7b42963568997d84a5153f35c5839a", + ] +} diff --git a/tests/fail/main.tf b/tests/fail/main.tf new file mode 100644 index 0000000..749cea6 --- /dev/null +++ b/tests/fail/main.tf @@ -0,0 +1,5 @@ +module "fail" { + source = "../../" + condition = false + error_message = "sample error" +} diff --git a/tests/pass/.terraform.lock.hcl b/tests/pass/.terraform.lock.hcl new file mode 100644 index 0000000..db7a7c3 --- /dev/null +++ b/tests/pass/.terraform.lock.hcl @@ -0,0 +1,22 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/cloudinit" { + version = "2.3.2" + constraints = ">= 2.3.1" + hashes = [ + "h1:2jb+BfT5T96dXxUD2LQ6MtVHpXErd7ZybmMvdWE2jd4=", + "zh:2487e498736ed90f53de8f66fe2b8c05665b9f8ff1506f751c5ee227c7f457d1", + "zh:3d8627d142942336cf65eea6eb6403692f47e9072ff3fa11c3f774a3b93130b3", + "zh:434b643054aeafb5df28d5529b72acc20c6f5ded24decad73b98657af2b53f4f", + "zh:436aa6c2b07d82aa6a9dd746a3e3a627f72787c27c80552ceda6dc52d01f4b6f", + "zh:458274c5aabe65ef4dbd61d43ce759287788e35a2da004e796373f88edcaa422", + "zh:54bc70fa6fb7da33292ae4d9ceef5398d637c7373e729ed4fce59bd7b8d67372", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:893ba267e18749c1a956b69be569f0d7bc043a49c3a0eb4d0d09a8e8b2ca3136", + "zh:95493b7517bce116f75cdd4c63b7c82a9d0d48ec2ef2f5eb836d262ef96d0aa7", + "zh:9ae21ab393be52e3e84e5cce0ef20e690d21f6c10ade7d9d9d22b39851bfeddc", + "zh:cc3b01ac2472e6d59358d54d5e4945032efbc8008739a6d4946ca1b621a16040", + "zh:f23bfe9758f06a1ec10ea3a81c9deedf3a7b42963568997d84a5153f35c5839a", + ] +} diff --git a/tests/pass/main.tf b/tests/pass/main.tf new file mode 100644 index 0000000..b1ac4e3 --- /dev/null +++ b/tests/pass/main.tf @@ -0,0 +1,5 @@ +module "pass" { + source = "../../" + condition = true + error_message = "sample error" +} diff --git a/versions.tf b/versions.tf index cfe9f63..eb46da1 100644 --- a/versions.tf +++ b/versions.tf @@ -1,9 +1,9 @@ terraform { required_version = ">= 0.13.0" required_providers { - template = { - source = "hashicorp/template" - version = ">= 2.2.0" + cloudinit = { + source = "hashicorp/cloudinit" + version = ">= 2.3.1" } } } From 4b337012a37fe738eba77ca2bb0f585720cdbe88 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sat, 18 Mar 2023 12:08:47 -0700 Subject: [PATCH 02/28] Update CICD.yml --- .github/workflows/CICD.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 8476874..331e487 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -27,23 +27,23 @@ jobs: container: ${{ matrix.container }} steps: - name: Initialize - Pass - id: init + id: init-pass uses: Invicton-Labs/terraform-module-testing/initialize@dev with: testing_path: tests/pass - name: Run Tests - Pass - id: tests + id: tests-pass uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev with: testing_path: tests/pass - name: Initialize - Fail - id: init + id: init-fail uses: Invicton-Labs/terraform-module-testing/initialize@dev with: testing_path: tests/fail - name: Run Tests - Fail - id: tests + id: tests-fail uses: Invicton-Labs/terraform-module-testing/apply-failure@dev with: testing_path: tests/fail From 4de4243842ec1f909e243ab3dee25f0de365f878 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 11:52:15 -0400 Subject: [PATCH 03/28] Update CICD.yml --- .github/workflows/CICD.yml | 100 +++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 331e487..a517b71 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -3,57 +3,69 @@ name: "Build" on: [push, pull_request] jobs: - Matrix: + Demo: runs-on: ubuntu-latest - steps: - name: Generate Matrix id: matrix - uses: Invicton-Labs/terraform-module-testing/matrix@main + uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev with: - minimum_tf_version: '0.13.0' + tf_vars: + - key1: value1 + - key2: value2 + + + # Matrix: + # runs-on: ubuntu-latest - - name: Output Matrix - run: | - echo "Strategy: ${{ steps.matrix.outputs.strategy }}" + # steps: + # - name: Generate Matrix + # id: matrix + # uses: Invicton-Labs/terraform-module-testing/matrix@main + # with: + # minimum_tf_version: '0.13.0' - outputs: - strategy: ${{ steps.matrix.outputs.strategy }} + # - name: Output Matrix + # run: | + # echo "Strategy: ${{ steps.matrix.outputs.strategy }}" + + # outputs: + # strategy: ${{ steps.matrix.outputs.strategy }} - Test: - needs: [Matrix] - strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} - runs-on: ${{ matrix.runs-on }} - container: ${{ matrix.container }} - steps: - - name: Initialize - Pass - id: init-pass - uses: Invicton-Labs/terraform-module-testing/initialize@dev - with: - testing_path: tests/pass - - name: Run Tests - Pass - id: tests-pass - uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev - with: - testing_path: tests/pass + # Test: + # needs: [Matrix] + # strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} + # runs-on: ${{ matrix.runs-on }} + # container: ${{ matrix.container }} + # steps: + # - name: Initialize - Pass + # id: init-pass + # uses: Invicton-Labs/terraform-module-testing/initialize@dev + # with: + # testing_path: tests/pass + # - name: Run Tests - Pass + # id: tests-pass + # uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev + # with: + # testing_path: tests/pass - - name: Initialize - Fail - id: init-fail - uses: Invicton-Labs/terraform-module-testing/initialize@dev - with: - testing_path: tests/fail - - name: Run Tests - Fail - id: tests-fail - uses: Invicton-Labs/terraform-module-testing/apply-failure@dev - with: - testing_path: tests/fail + # - name: Initialize - Fail + # id: init-fail + # uses: Invicton-Labs/terraform-module-testing/initialize@dev + # with: + # testing_path: tests/fail + # - name: Run Tests - Fail + # id: tests-fail + # uses: Invicton-Labs/terraform-module-testing/apply-failure@dev + # with: + # testing_path: tests/fail - # This job just waits for all other jobs to pass. We have it here - # so our branch protection rule can reference a single job, instead - # of needing to list every matrix value of every job above. - Passed: - runs-on: ubuntu-latest - needs: [Test] - steps: - - name: Mark tests as passed - run: echo "🎉" \ No newline at end of file + # # This job just waits for all other jobs to pass. We have it here + # # so our branch protection rule can reference a single job, instead + # # of needing to list every matrix value of every job above. + # Passed: + # runs-on: ubuntu-latest + # needs: [Test] + # steps: + # - name: Mark tests as passed + # run: echo "🎉" \ No newline at end of file From 37b908d8776530b99c6daa0bb7b5e789494a4ad8 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 11:52:54 -0400 Subject: [PATCH 04/28] Update CICD.yml --- .github/workflows/CICD.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index a517b71..40fd2cb 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -10,9 +10,9 @@ jobs: id: matrix uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev with: - tf_vars: - - key1: value1 - - key2: value2 + tf_vars: | + key1: value1 + key2: value2 # Matrix: From 19304ac670e5a26a9ba283b2b1a9d0a67fe94847 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 11:53:32 -0400 Subject: [PATCH 05/28] Update CICD.yml --- .github/workflows/CICD.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 40fd2cb..c5a7029 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -11,8 +11,8 @@ jobs: uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev with: tf_vars: | - key1: value1 - key2: value2 + key1=value1 + key2=value2 # Matrix: From 7acac4d7b26e6410f0607b686c23992ac8131a85 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 12:28:36 -0400 Subject: [PATCH 06/28] Update CICD.yml --- .github/workflows/CICD.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index c5a7029..4d1c3be 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -13,6 +13,8 @@ jobs: tf_vars: | key1=value1 key2=value2 + key3=va"l"ue3 + key4=val'u'e4 # Matrix: From 5d2c67336415d29015cea80f30fb2fe7ed4f8afd Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 12:42:27 -0400 Subject: [PATCH 07/28] Testing --- .github/workflows/CICD.yml | 1 + tests/outputs/main.tf | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/outputs/main.tf diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 4d1c3be..af802ab 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -10,6 +10,7 @@ jobs: id: matrix uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev with: + tf_path: tests/outputs tf_vars: | key1=value1 key2=value2 diff --git a/tests/outputs/main.tf b/tests/outputs/main.tf new file mode 100644 index 0000000..935d1a2 --- /dev/null +++ b/tests/outputs/main.tf @@ -0,0 +1,25 @@ +variable "key1" { + type = number +} +variable "key2" { + type = string +} +variable "key3" { + type = list(string) +} +variable "key4" { + type = map(string) +} + +output "key1" { + value = var.key1 +} +output "key2" { + value = var.key1 +} +output "key3" { + value = var.key1 +} +output "key4" { + value = var.key1 +} From 24846b4611b7bc70db6e12e054e57ab0003bb4c7 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 12:43:30 -0400 Subject: [PATCH 08/28] Update CICD.yml --- .github/workflows/CICD.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index af802ab..8c3428b 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -12,10 +12,10 @@ jobs: with: tf_path: tests/outputs tf_vars: | - key1=value1 - key2=value2 - key3=va"l"ue3 - key4=val'u'e4 + key1=444 + key2=va"l"u'e'2 + key3=["abc", "def"] + key4={"subkey1": "subval1", "subkey2": "subval2"} # Matrix: From a8c60f9c2978805dc878d126f4d33da2f674cfc9 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 12:51:22 -0400 Subject: [PATCH 09/28] Update CICD.yml --- .github/workflows/CICD.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 8c3428b..04ab698 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -6,6 +6,12 @@ jobs: Demo: runs-on: ubuntu-latest steps: + - name: Initialize Terraform + id: matrix + uses: Invicton-Labs/terraform-module-testing/initialize@dev + with: + tf_path: tests/outputs + - name: Generate Matrix id: matrix uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev From e584f10332736fd86152534ef7c427b4e6918ff7 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 12:51:44 -0400 Subject: [PATCH 10/28] Update CICD.yml --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 04ab698..a6b55f1 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Initialize Terraform - id: matrix + id: initialize uses: Invicton-Labs/terraform-module-testing/initialize@dev with: tf_path: tests/outputs From e984e927eaa0910213764da8b76f0d5a1da89a0b Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 13:10:03 -0400 Subject: [PATCH 11/28] Update CICD.yml --- .github/workflows/CICD.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index a6b55f1..460d219 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -17,11 +17,11 @@ jobs: uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev with: tf_path: tests/outputs - tf_vars: | - key1=444 - key2=va"l"u'e'2 - key3=["abc", "def"] - key4={"subkey1": "subval1", "subkey2": "subval2"} + tf_args: | + -var="key1=444" + -var="key2=va"l"u'e'2" + -var="key3=[\"abc\", \"def\"]" + -var="key4={\"subkey1\": \"subval1\", \"subkey2\": \"subval2\"}" # Matrix: From fd465e23783cb8786d85e17278b29f15d36287e8 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 13:10:37 -0400 Subject: [PATCH 12/28] Update main.tf --- tests/outputs/main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/outputs/main.tf b/tests/outputs/main.tf index 935d1a2..0a52dcf 100644 --- a/tests/outputs/main.tf +++ b/tests/outputs/main.tf @@ -15,11 +15,11 @@ output "key1" { value = var.key1 } output "key2" { - value = var.key1 + value = var.key2 } output "key3" { - value = var.key1 + value = var.key3 } output "key4" { - value = var.key1 + value = var.key4 } From f23f1a6082a169cdc2c8312d4c50549d494f2e19 Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 13:11:18 -0400 Subject: [PATCH 13/28] Update CICD.yml --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 460d219..bee3979 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -19,7 +19,7 @@ jobs: tf_path: tests/outputs tf_args: | -var="key1=444" - -var="key2=va"l"u'e'2" + -var="key2=va\"l\"u'e'2" -var="key3=[\"abc\", \"def\"]" -var="key4={\"subkey1\": \"subval1\", \"subkey2\": \"subval2\"}" From 5a0a77fcbf0929a733c6d68c9b0e997cd11fb50d Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 13:15:46 -0400 Subject: [PATCH 14/28] Update CICD --- .github/workflows/CICD.yml | 109 +++++++++++++++---------------------- tests/outputs/main.tf | 25 --------- 2 files changed, 44 insertions(+), 90 deletions(-) delete mode 100644 tests/outputs/main.tf diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index bee3979..5ed00e0 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -3,78 +3,57 @@ name: "Build" on: [push, pull_request] jobs: - Demo: + Matrix: runs-on: ubuntu-latest - steps: - - name: Initialize Terraform - id: initialize - uses: Invicton-Labs/terraform-module-testing/initialize@dev - with: - tf_path: tests/outputs + steps: - name: Generate Matrix id: matrix - uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev + uses: Invicton-Labs/terraform-module-testing/matrix@dev with: - tf_path: tests/outputs - tf_args: | - -var="key1=444" - -var="key2=va\"l\"u'e'2" - -var="key3=[\"abc\", \"def\"]" - -var="key4={\"subkey1\": \"subval1\", \"subkey2\": \"subval2\"}" + minimum_tf_version: '0.13.0' + - name: Output Matrix + run: | + echo "Strategy: ${{ steps.matrix.outputs.strategy }}" - # Matrix: - # runs-on: ubuntu-latest - - # steps: - # - name: Generate Matrix - # id: matrix - # uses: Invicton-Labs/terraform-module-testing/matrix@main - # with: - # minimum_tf_version: '0.13.0' - - # - name: Output Matrix - # run: | - # echo "Strategy: ${{ steps.matrix.outputs.strategy }}" - - # outputs: - # strategy: ${{ steps.matrix.outputs.strategy }} + outputs: + strategy: ${{ steps.matrix.outputs.strategy }} - # Test: - # needs: [Matrix] - # strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} - # runs-on: ${{ matrix.runs-on }} - # container: ${{ matrix.container }} - # steps: - # - name: Initialize - Pass - # id: init-pass - # uses: Invicton-Labs/terraform-module-testing/initialize@dev - # with: - # testing_path: tests/pass - # - name: Run Tests - Pass - # id: tests-pass - # uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev - # with: - # testing_path: tests/pass + Test: + needs: [Matrix] + strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} + runs-on: ${{ matrix.runs-on }} + container: ${{ matrix.container }} + steps: + - name: Initialize - Pass + id: init-pass + uses: Invicton-Labs/terraform-module-testing/initialize@dev + with: + tf_path: tests/pass + - name: Run Tests - Pass + id: tests-pass + uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev + with: + tf_path: tests/pass - # - name: Initialize - Fail - # id: init-fail - # uses: Invicton-Labs/terraform-module-testing/initialize@dev - # with: - # testing_path: tests/fail - # - name: Run Tests - Fail - # id: tests-fail - # uses: Invicton-Labs/terraform-module-testing/apply-failure@dev - # with: - # testing_path: tests/fail + - name: Initialize - Fail + id: init-fail + uses: Invicton-Labs/terraform-module-testing/initialize@dev + with: + tf_path: tests/fail + - name: Run Tests - Fail + id: tests-fail + uses: Invicton-Labs/terraform-module-testing/apply-failure@dev + with: + tf_path: tests/fail - # # This job just waits for all other jobs to pass. We have it here - # # so our branch protection rule can reference a single job, instead - # # of needing to list every matrix value of every job above. - # Passed: - # runs-on: ubuntu-latest - # needs: [Test] - # steps: - # - name: Mark tests as passed - # run: echo "🎉" \ No newline at end of file + # This job just waits for all other jobs to pass. We have it here + # so our branch protection rule can reference a single job, instead + # of needing to list every matrix value of every job above. + Passed: + runs-on: ubuntu-latest + needs: [Test] + steps: + - name: Mark tests as passed + run: echo "🎉" \ No newline at end of file diff --git a/tests/outputs/main.tf b/tests/outputs/main.tf deleted file mode 100644 index 0a52dcf..0000000 --- a/tests/outputs/main.tf +++ /dev/null @@ -1,25 +0,0 @@ -variable "key1" { - type = number -} -variable "key2" { - type = string -} -variable "key3" { - type = list(string) -} -variable "key4" { - type = map(string) -} - -output "key1" { - value = var.key1 -} -output "key2" { - value = var.key2 -} -output "key3" { - value = var.key3 -} -output "key4" { - value = var.key4 -} From 100de725b0a2474305a08ae7fc47364d9abe1e9d Mon Sep 17 00:00:00 2001 From: KyleKotowick Date: Sun, 26 Mar 2023 13:43:26 -0400 Subject: [PATCH 15/28] Update CICD.yml --- .github/workflows/CICD.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 5ed00e0..20b5f22 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Generate Matrix id: matrix - uses: Invicton-Labs/terraform-module-testing/matrix@dev + uses: Invicton-Labs/terraform-module-testing/matrix@v0.1.0 with: minimum_tf_version: '0.13.0' @@ -28,23 +28,23 @@ jobs: steps: - name: Initialize - Pass id: init-pass - uses: Invicton-Labs/terraform-module-testing/initialize@dev + uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 with: tf_path: tests/pass - name: Run Tests - Pass id: tests-pass - uses: Invicton-Labs/terraform-module-testing/apply-destroy@dev + uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.1.0 with: tf_path: tests/pass - name: Initialize - Fail id: init-fail - uses: Invicton-Labs/terraform-module-testing/initialize@dev + uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 with: tf_path: tests/fail - name: Run Tests - Fail id: tests-fail - uses: Invicton-Labs/terraform-module-testing/apply-failure@dev + uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.1.0 with: tf_path: tests/fail From 00a8319394a314c3355154dfb3e9ee2b8cf1ee7c Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Sun, 7 Jul 2024 12:05:50 -0400 Subject: [PATCH 16/28] Refactor to use new variable validation capabilities --- LICENSE | 2 +- main.tf | 13 ------------- outputs.tf | 12 +++++++++++- variables.tf | 19 ++++++++++++++----- versions.tf | 8 +------- 5 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 main.tf diff --git a/LICENSE b/LICENSE index 65ede90..667eff7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021-2022 Invicton Labs (https://invictonlabs.com) +Copyright (c) 2021-2024 Invicton Labs (https://invictonlabs.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/main.tf b/main.tf deleted file mode 100644 index a019ad6..0000000 --- a/main.tf +++ /dev/null @@ -1,13 +0,0 @@ -// Previously, this check was done in a local. Somewhere around TF v1.4.0 though, it changed -// such that locals wouldn't be computed unless they were necessary for a resource or data source. -// Therefore, unless the "checked" output parameter was actually used somewhere in the parent module, -// the assertion check would never actually run. By putting it in a data source, it will always run -// regardless of whether any outputs of this module are used in the parent module. The `null` data -// source would be ideal, but it throws a deprecation warning. This CloudInit data source is the -// next best alternative, since it is fast and doesn't interact with the operating system at all -// (unlike an external data source, for example), and isn't deprecated. -data "cloudinit_config" "check" { - part { - content = var.condition ? "" : SEE_ABOVE_ERROR_MESSAGE(true ? null : "ERROR: ${var.error_message}") - } -} diff --git a/outputs.tf b/outputs.tf index d2bce0e..c653073 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,4 +1,14 @@ +output "error_message" { + description = "The value of the `error_message` input variable." + value = var.error_message +} + +output "condition" { + description = "The value of the `condition` input variable." + value = var.condition +} + output "checked" { description = "Whether the condition has been checked (used for assertion dependencies)." - value = data.cloudinit_config.check.rendered == "" ? true : true + value = var.condition == true ? true : true } diff --git a/variables.tf b/variables.tf index ed0106b..0350283 100644 --- a/variables.tf +++ b/variables.tf @@ -1,9 +1,18 @@ -variable "condition" { - description = "The condition to ensure is `true`." - type = bool -} - variable "error_message" { description = "The error message to display if the condition evaluates to `false`." type = string + nullable = false +} + +variable "condition" { + description = "The condition to ensure is `true`." + type = bool + validation { + // We have to use var.error_message != null to force the evaluation to wait + // until var.error_message is known. Otherwise, it can fail during the validation + // phase but won't output the proper error message. + // https://github.com/hashicorp/terraform/issues/35397 + condition = var.error_message != null && var.condition == true + error_message = var.error_message + } } diff --git a/versions.tf b/versions.tf index eb46da1..bfb98ab 100644 --- a/versions.tf +++ b/versions.tf @@ -1,9 +1,3 @@ terraform { - required_version = ">= 0.13.0" - required_providers { - cloudinit = { - source = "hashicorp/cloudinit" - version = ">= 2.3.1" - } - } + required_version = ">= 1.9.0" } From bdc74f48f5788bd4e0aa763732642d84fa099255 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Sun, 7 Jul 2024 12:07:03 -0400 Subject: [PATCH 17/28] Update CI/CD minimum Terraform version --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 20b5f22..0154a6d 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -11,7 +11,7 @@ jobs: id: matrix uses: Invicton-Labs/terraform-module-testing/matrix@v0.1.0 with: - minimum_tf_version: '0.13.0' + minimum_tf_version: '1.9.0' - name: Output Matrix run: | From f37120b51281fdd3ed247540a1440ba3f10a5097 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 11:53:27 -0400 Subject: [PATCH 18/28] Update CICD.yml --- .github/workflows/CICD.yml | 72 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 0154a6d..5be9843 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Generate Matrix id: matrix - uses: Invicton-Labs/terraform-module-testing/matrix@v0.1.0 + uses: Invicton-Labs/terraform-module-testing/matrix@a4a51fb1fa70a00b9f468ff48540cb44e38c1c74 with: minimum_tf_version: '1.9.0' @@ -20,40 +20,40 @@ jobs: outputs: strategy: ${{ steps.matrix.outputs.strategy }} - Test: - needs: [Matrix] - strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} - runs-on: ${{ matrix.runs-on }} - container: ${{ matrix.container }} - steps: - - name: Initialize - Pass - id: init-pass - uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 - with: - tf_path: tests/pass - - name: Run Tests - Pass - id: tests-pass - uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.1.0 - with: - tf_path: tests/pass + # Test: + # needs: [Matrix] + # strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} + # runs-on: ${{ matrix.runs-on }} + # container: ${{ matrix.container }} + # steps: + # - name: Initialize - Pass + # id: init-pass + # uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 + # with: + # tf_path: tests/pass + # - name: Run Tests - Pass + # id: tests-pass + # uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.1.0 + # with: + # tf_path: tests/pass - - name: Initialize - Fail - id: init-fail - uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 - with: - tf_path: tests/fail - - name: Run Tests - Fail - id: tests-fail - uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.1.0 - with: - tf_path: tests/fail + # - name: Initialize - Fail + # id: init-fail + # uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 + # with: + # tf_path: tests/fail + # - name: Run Tests - Fail + # id: tests-fail + # uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.1.0 + # with: + # tf_path: tests/fail - # This job just waits for all other jobs to pass. We have it here - # so our branch protection rule can reference a single job, instead - # of needing to list every matrix value of every job above. - Passed: - runs-on: ubuntu-latest - needs: [Test] - steps: - - name: Mark tests as passed - run: echo "🎉" \ No newline at end of file + # # This job just waits for all other jobs to pass. We have it here + # # so our branch protection rule can reference a single job, instead + # # of needing to list every matrix value of every job above. + # Passed: + # runs-on: ubuntu-latest + # needs: [Test] + # steps: + # - name: Mark tests as passed + # run: echo "🎉" \ No newline at end of file From 4d01d6210ef3b7df469d3dbe53bc61d17ba3e7ca Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 11:55:55 -0400 Subject: [PATCH 19/28] Update CICD.yml --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 5be9843..65c2cda 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Generate Matrix id: matrix - uses: Invicton-Labs/terraform-module-testing/matrix@a4a51fb1fa70a00b9f468ff48540cb44e38c1c74 + uses: Invicton-Labs/terraform-module-testing/matrix@feat/additional-os with: minimum_tf_version: '1.9.0' From 4f2561d873e1270b473d7923391d8aed3fb92fdf Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 12:04:15 -0400 Subject: [PATCH 20/28] Update CICD.yml --- .github/workflows/CICD.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 65c2cda..e3b320d 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -12,6 +12,8 @@ jobs: uses: Invicton-Labs/terraform-module-testing/matrix@feat/additional-os with: minimum_tf_version: '1.9.0' + additional_runners: 'macos-13, windows-2019' + additional_images: 'amazonlinux:2' - name: Output Matrix run: | From 47726b421bad6f423e7edf5f70ba8b1809f5987a Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 12:48:08 -0400 Subject: [PATCH 21/28] Update CICD.yml --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index e3b320d..0b9ee5d 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -11,7 +11,7 @@ jobs: id: matrix uses: Invicton-Labs/terraform-module-testing/matrix@feat/additional-os with: - minimum_tf_version: '1.9.0' + minimum_tf_version: '1.7.0' additional_runners: 'macos-13, windows-2019' additional_images: 'amazonlinux:2' From 17bc1b7814b6f678ed12d4c2061939759bf6caf6 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 12:58:42 -0400 Subject: [PATCH 22/28] Update CICD.yml --- .github/workflows/CICD.yml | 70 +++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 0b9ee5d..4cc5ac0 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -22,40 +22,40 @@ jobs: outputs: strategy: ${{ steps.matrix.outputs.strategy }} - # Test: - # needs: [Matrix] - # strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} - # runs-on: ${{ matrix.runs-on }} - # container: ${{ matrix.container }} - # steps: - # - name: Initialize - Pass - # id: init-pass - # uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 - # with: - # tf_path: tests/pass - # - name: Run Tests - Pass - # id: tests-pass - # uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.1.0 - # with: - # tf_path: tests/pass + Test: + needs: [Matrix] + strategy: ${{ fromJSON(needs.Matrix.outputs.strategy)}} + runs-on: ${{ matrix.runs-on }} + container: ${{ matrix.container }} + steps: + - name: Initialize - Pass + id: init-pass + uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 + with: + tf_path: tests/pass + - name: Run Tests - Pass + id: tests-pass + uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.1.0 + with: + tf_path: tests/pass - # - name: Initialize - Fail - # id: init-fail - # uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 - # with: - # tf_path: tests/fail - # - name: Run Tests - Fail - # id: tests-fail - # uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.1.0 - # with: - # tf_path: tests/fail + - name: Initialize - Fail + id: init-fail + uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 + with: + tf_path: tests/fail + - name: Run Tests - Fail + id: tests-fail + uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.1.0 + with: + tf_path: tests/fail - # # This job just waits for all other jobs to pass. We have it here - # # so our branch protection rule can reference a single job, instead - # # of needing to list every matrix value of every job above. - # Passed: - # runs-on: ubuntu-latest - # needs: [Test] - # steps: - # - name: Mark tests as passed - # run: echo "🎉" \ No newline at end of file + # This job just waits for all other jobs to pass. We have it here + # so our branch protection rule can reference a single job, instead + # of needing to list every matrix value of every job above. + Passed: + runs-on: ubuntu-latest + needs: [Test] + steps: + - name: Mark tests as passed + run: echo "🎉" \ No newline at end of file From 32e3442d9d23abeabd1044e8b17acbcf3bf85973 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 13:03:21 -0400 Subject: [PATCH 23/28] Update CICD.yml --- .github/workflows/CICD.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 4cc5ac0..eb31f65 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -30,23 +30,23 @@ jobs: steps: - name: Initialize - Pass id: init-pass - uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 + uses: Invicton-Labs/terraform-module-testing/initialize@feat/additional-os with: tf_path: tests/pass - name: Run Tests - Pass id: tests-pass - uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.1.0 + uses: Invicton-Labs/terraform-module-testing/apply-destroy@feat/additional-os with: tf_path: tests/pass - name: Initialize - Fail id: init-fail - uses: Invicton-Labs/terraform-module-testing/initialize@v0.1.0 + uses: Invicton-Labs/terraform-module-testing/initialize@feat/additional-os with: tf_path: tests/fail - name: Run Tests - Fail id: tests-fail - uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.1.0 + uses: Invicton-Labs/terraform-module-testing/apply-failure@feat/additional-os with: tf_path: tests/fail @@ -58,4 +58,4 @@ jobs: needs: [Test] steps: - name: Mark tests as passed - run: echo "🎉" \ No newline at end of file + run: echo "🎉" From da3d24f3849c92c8fe44c2a78bebc7c8685ea151 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 13:14:26 -0400 Subject: [PATCH 24/28] Update CICD.yml --- .github/workflows/CICD.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index eb31f65..8ecd9a5 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -11,7 +11,7 @@ jobs: id: matrix uses: Invicton-Labs/terraform-module-testing/matrix@feat/additional-os with: - minimum_tf_version: '1.7.0' + minimum_tf_version: '1.9.0' additional_runners: 'macos-13, windows-2019' additional_images: 'amazonlinux:2' From 7991f18a45a736a7f60f00cfd5ecce686ad77ac0 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 13:16:50 -0400 Subject: [PATCH 25/28] Update CICD.yml --- .github/workflows/CICD.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 8ecd9a5..e285987 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -13,7 +13,6 @@ jobs: with: minimum_tf_version: '1.9.0' additional_runners: 'macos-13, windows-2019' - additional_images: 'amazonlinux:2' - name: Output Matrix run: | From 0037be7ef82d4e2a158c2df00b3d0f0e21b948d4 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 13:36:31 -0400 Subject: [PATCH 26/28] Update CICD.yml --- .github/workflows/CICD.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index e285987..8ecd9a5 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -13,6 +13,7 @@ jobs: with: minimum_tf_version: '1.9.0' additional_runners: 'macos-13, windows-2019' + additional_images: 'amazonlinux:2' - name: Output Matrix run: | From 1ef9c6db0a31e86f00b873b310851ecc0711fe8d Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 15:03:48 -0400 Subject: [PATCH 27/28] Update CICD.yml --- .github/workflows/CICD.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 8ecd9a5..e285987 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -13,7 +13,6 @@ jobs: with: minimum_tf_version: '1.9.0' additional_runners: 'macos-13, windows-2019' - additional_images: 'amazonlinux:2' - name: Output Matrix run: | From 40a0160150e474bcf8dbbb6cbd923a139ac4a9c6 Mon Sep 17 00:00:00 2001 From: Kyle Kotowick Date: Thu, 11 Jul 2024 15:08:57 -0400 Subject: [PATCH 28/28] Update CICD.yml --- .github/workflows/CICD.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index e285987..271d828 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -9,10 +9,9 @@ jobs: steps: - name: Generate Matrix id: matrix - uses: Invicton-Labs/terraform-module-testing/matrix@feat/additional-os + uses: Invicton-Labs/terraform-module-testing/matrix@v0.2.0 with: minimum_tf_version: '1.9.0' - additional_runners: 'macos-13, windows-2019' - name: Output Matrix run: | @@ -29,23 +28,23 @@ jobs: steps: - name: Initialize - Pass id: init-pass - uses: Invicton-Labs/terraform-module-testing/initialize@feat/additional-os + uses: Invicton-Labs/terraform-module-testing/initialize@v0.2.0 with: tf_path: tests/pass - name: Run Tests - Pass id: tests-pass - uses: Invicton-Labs/terraform-module-testing/apply-destroy@feat/additional-os + uses: Invicton-Labs/terraform-module-testing/apply-destroy@v0.2.0 with: tf_path: tests/pass - name: Initialize - Fail id: init-fail - uses: Invicton-Labs/terraform-module-testing/initialize@feat/additional-os + uses: Invicton-Labs/terraform-module-testing/initialize@v0.2.0 with: tf_path: tests/fail - name: Run Tests - Fail id: tests-fail - uses: Invicton-Labs/terraform-module-testing/apply-failure@feat/additional-os + uses: Invicton-Labs/terraform-module-testing/apply-failure@v0.2.0 with: tf_path: tests/fail