diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 919a16a1..114f04fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,11 +54,13 @@ jobs: terraform_version: ${{ env.TF_VERSION }} terraform_wrapper: false - - name: Config Terraform plugin cache and initialize providers + - name: Config Terraform plugin cache run: | echo 'plugin_cache_dir="$HOME/.terraform.d/plugin-cache"' >~/.terraformrc mkdir --parents ~/.terraform.d/plugin-cache - sed -i -e '/# CI hook/e cat tests/test-versions.tf' default-versions.tf + + - name: Initialize providers + run: | terraform init # avoid conflicts with user-installed providers on local machines @@ -105,13 +107,6 @@ jobs: run: | terraform init - - name: Config Terraform plugin cache and initialize providers - run: | - echo 'plugin_cache_dir="$HOME/.terraform.d/plugin-cache"' >~/.terraformrc - mkdir --parents ~/.terraform.d/plugin-cache - sed -i -e '/# CI hook/e cat tests/test-versions.tf' default-versions.tf - terraform init - # avoid conflicts with user-installed providers on local machines - name: Pin provider versions run: | @@ -156,13 +151,6 @@ jobs: run: | terraform init - - name: Config Terraform plugin cache and initialize providers - run: | - echo 'plugin_cache_dir="$HOME/.terraform.d/plugin-cache"' >~/.terraformrc - mkdir --parents ~/.terraform.d/plugin-cache - sed -i -e '/# CI hook/e cat tests/test-versions.tf' default-versions.tf - terraform init - # avoid conflicts with user-installed providers on local machines - name: Pin provider versions run: | @@ -207,13 +195,6 @@ jobs: run: | terraform init - - name: Config Terraform plugin cache and initialize providers - run: | - echo 'plugin_cache_dir="$HOME/.terraform.d/plugin-cache"' >~/.terraformrc - mkdir --parents ~/.terraform.d/plugin-cache - sed -i -e '/# CI hook/e cat tests/test-versions.tf' default-versions.tf - terraform init - # avoid conflicts with user-installed providers on local machines - name: Pin provider versions run: | diff --git a/default-versions.tf b/default-versions.tf index 6f800846..ab57f9e9 100644 --- a/default-versions.tf +++ b/default-versions.tf @@ -23,7 +23,14 @@ terraform { source = "hashicorp/google-beta" version = ">= 4.36.0" # tftest } - # CI hook + # used in modules + archive = { + source = "hashicorp/archive" + } + # used in fast + local = { + source = "hashicorp/local" + } } } diff --git a/tests/test-versions.tf b/tests/test-versions.tf deleted file mode 100644 index 2ba9b0df..00000000 --- a/tests/test-versions.tf +++ /dev/null @@ -1,4 +0,0 @@ -# skip boilerplate check -archive = { source = "hashicorp/archive" } -local = { source = "hashicorp/local" } -random = { source = "hashicorp/random" }