chore: Prepare for v1.11.0 release (#366) #44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Terraform Provider testing workflow. | |
| name: Terraform Provider Build Tests | |
| # This GitHub action runs your tests for each pull request and push. | |
| # Optionally, you can turn it on using a schedule for regular testing. | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| paths-ignore: | |
| - '*.md' | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '*.md' | |
| workflow_dispatch: | |
| workflow_call: | |
| # Testing only needs permissions to read the repository contents. | |
| permissions: | |
| contents: read | |
| # Define the latest Terraform version to use for upload of coverage report | |
| env: | |
| LATEST_VERSION: 1.14.* | |
| jobs: | |
| # Ensure project builds before running testing matrix | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/[email protected] # v4.0.0 | |
| - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| #cache: true | |
| - run: go mod download | |
| - run: go build -v . | |
| - name: Run linters | |
| uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v3.7.1 | |
| with: | |
| version: latest | |
| skip-cache: true | |
| generate: | |
| if: github.event.pull_request.draft == false | |
| name: Docu Generation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] # v4.0.0 | |
| - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
| with: | |
| terraform_version: ${{ env.LATEST_VERSION }} | |
| terraform_wrapper: false | |
| - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - run: go generate ./... | |
| - name: git diff | |
| run: | | |
| git diff --compact-summary --exit-code || \ | |
| (echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1) | |
| # Run acceptance tests in a matrix with Terraform CLI versions | |
| test_with_terraform_versions: | |
| if: github.event.pull_request.draft == false | |
| name: Terraform Provider Acceptance Tests | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # List of Terraform versions to be tested - last three versions are in scope | |
| # Check https://endoflife.date/terraform for end of support dates | |
| # '1.6.*' end of security support 10 Apr 2024 | |
| # '1.7.*' end of security support 26 Jun 2024 | |
| # '1.8.*' end of security support 26 Nov 2024 | |
| # '1.9.*' #end of security support 27 Feb 2025 | |
| # '1.10.*' end of security support 14 May 2025 | |
| # '1.11.*' end of security support 20 Aug 2025 | |
| terraform: | |
| - '1.12.*' | |
| - '1.13.*' | |
| - '1.14.*' | |
| steps: | |
| - uses: actions/[email protected] # v4.0.0 | |
| - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
| with: | |
| terraform_version: ${{ matrix.terraform }} | |
| terraform_wrapper: false | |
| - run: go mod download | |
| - if: ${{ matrix.terraform != env.LATEST_VERSION }} | |
| env: | |
| TF_ACC: "1" | |
| run: go test -v -timeout=900s -parallel=4 ./... | |
| timeout-minutes: 20 | |
| - if: ${{ matrix.terraform == env.LATEST_VERSION }} | |
| env: | |
| TF_ACC: "1" | |
| uses: robherley/go-test-action@v0 | |
| with: | |
| testArguments: -v -cover -coverprofile=cover.out -timeout=900s -parallel=4 ./... | |
| - uses: actions/upload-artifact@v5 | |
| if: ${{ matrix.terraform == env.LATEST_VERSION }} | |
| with: | |
| name: coverage-report | |
| path: cover.out |