@@ -36,15 +36,42 @@ jobs:
36
36
matrix :
37
37
directory : ${{ fromJson(needs.collectInputs.outputs.directories) }}
38
38
steps :
39
+ # https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
40
+ - name : Delete huge unnecessary tools folder
41
+ run : |
42
+ rm -rf /opt/hostedtoolcache/CodeQL
43
+ rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk
44
+ rm -rf /opt/hostedtoolcache/Ruby
45
+ rm -rf /opt/hostedtoolcache/go
39
46
- name : Checkout
40
- uses : actions/checkout@v4
47
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
48
+ - name : Setup Go
49
+ uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
50
+ with :
51
+ go-version-file : ' go.mod'
52
+ cache : true
53
+ cache-dependency-path : |
54
+ **/go.sum
55
+ **/go.mod
56
+ - name : Build provider
57
+ run : |
58
+ make build
59
+ make terraformrc
60
+ TF_IN_AUTOMATION=true
61
+ TF_PLUGIN_VERSION="99.0.0"
62
+ TF_PLUGIN_BINARY_NAME="terraform-provider-flux"
63
+ TF_PLUGIN_BINARY_PATH="${HOME}/.terraform.d/plugins/registry.terraform.io/fluxcd/flux/$TF_PLUGIN_VERSION/$(go env GOOS)_$(go env GOARCH)/"
64
+
65
+ if [ ! -f $TF_PLUGIN_BINARY_PATH ]; then
66
+ mkdir -p $TF_PLUGIN_BINARY_PATH
67
+ fi
41
68
69
+ cp ./bin/$TF_PLUGIN_BINARY_NAME $TF_PLUGIN_BINARY_PATH
42
70
- name : Terraform min/max versions
43
71
id : minMax
44
72
45
73
with :
46
74
directory : ${{ matrix.directory }}
47
-
48
75
- name : Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
49
76
# Run only validate pre-commit check on min version supported
50
77
if : ${{ matrix.directory != '.' }}
54
81
tflint-version : ${{ env.TFLINT_VERSION }}
55
82
terraform-docs-version : ${{ env.TERRAFORM_DOCS_VERSION }}
56
83
args : ' terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
57
-
58
84
- name : Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
59
85
# Run only validate pre-commit check on min version supported
60
86
if : ${{ matrix.directory == '.' }}
0 commit comments