diff --git a/.github/actions/acc_test/action.yaml b/.github/actions/acc_test/action.yaml index de07ff65..30617e15 100644 --- a/.github/actions/acc_test/action.yaml +++ b/.github/actions/acc_test/action.yaml @@ -83,14 +83,31 @@ runs: check-latest: true go-version-file: 'go.mod' + - name: Determine GOMODCACHE + shell: bash + id: goenv + run: | + set -e + echo "gomodcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + + - name: Restore cached GO pkg + id: cache-gopkg + uses: actions/cache/restore@v5 + with: + path: "${{ steps.goenv.outputs.gomodcache }}" + key: ${{ runner.os }}-gopkg + - name: Install go tools + if: steps.cache-gopkg.outputs.cache-hit != 'true' shell: bash run: | set -e go mod download go install golang.org/x/tools/cmd/goimports@latest - go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2 - go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@v0.24.0 + go install github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework@latest + go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest + go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest + go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest # - name: Prepare pkg_gen directory # shell: bash @@ -101,15 +118,25 @@ runs: shell: bash run: go mod tidy + - name: Save GO package Cache + id: cache-gopkg-save + uses: actions/cache/save@v5 + with: + path: | + ${{ steps.goenv.outputs.gomodcache }} + key: ${{ runner.os }}-gopkg + - name: Ensure service account file exists shell: bash run: | set -e if [[ ! -f "${{ inputs.service_account_json_file_path }}" ]]; then - if [[ -z "${{ inputs.service_account_json_file_content }}" ]]; then - echo "unable to find service account file '${{ inputs.service_account_json_file_path }}' \n and service_account_json_file_content is empty" + echo "unable to find service account file '${{ inputs.service_account_json_file_path }}'" + if [ -z "${{ inputs.service_account_json_file_content }}" ]; then + echo "ERROR: service_account_json_file_content MUST NOT be empty if account file is missing" exit 1 fi + echo "creating service account file '${{ inputs.service_account_json_file_path }}'" echo "${{ inputs.service_account_json_file_content }}" > "${{ inputs.service_account_json_file_path }}" fi cat "${{ inputs.service_account_json_file_path }}"