Improve handling of tf plugin cache in tests (#885)
* disable tf cache in CI * re-enable cache * try a different approach
This commit is contained in:
parent
49d5e21a4b
commit
af447e34e6
|
@ -54,13 +54,11 @@ jobs:
|
|||
terraform_version: ${{ env.TF_VERSION }}
|
||||
terraform_wrapper: false
|
||||
|
||||
- name: Config Terraform plugin cache
|
||||
- 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
|
||||
|
||||
- name: Initialize providers
|
||||
run: |
|
||||
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
|
||||
|
@ -107,6 +105,13 @@ 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: |
|
||||
|
@ -151,6 +156,13 @@ 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: |
|
||||
|
@ -195,6 +207,13 @@ 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: |
|
||||
|
|
|
@ -23,14 +23,7 @@ terraform {
|
|||
source = "hashicorp/google-beta"
|
||||
version = ">= 4.36.0" # tftest
|
||||
}
|
||||
# used in modules
|
||||
archive = {
|
||||
source = "hashicorp/archive"
|
||||
}
|
||||
# used in fast
|
||||
local = {
|
||||
source = "hashicorp/local"
|
||||
}
|
||||
# CI hook
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# skip boilerplate check
|
||||
archive = { source = "hashicorp/archive" }
|
||||
local = { source = "hashicorp/local" }
|
||||
random = { source = "hashicorp/random" }
|
Loading…
Reference in New Issue