Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website: Update GitHub Actions example for setup-go@v4 and using go.mod version #169

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions website/docs/plugin/testing/acceptance-tests/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Create a [GitHub Actions workflow](https://docs.github.com/en/actions/using-work

Use the [`matrix`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix) strategy for more advanced configuration, such as running acceptance testing against multiple Terraform CLI versions.

The following example workflow runs acceptance testing for the provider using the latest patch versions of Go 1.19 and Terraform CLI 1.3:
The following example workflow runs acceptance testing for the provider using the latest patch versions of the Go version in the `go.mod` file and Terraform CLI 1.5:

```yaml
name: Terraform Provider Tests
Expand All @@ -157,12 +157,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version-file: 'go.mod'
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: '1.3.*'
terraform_version: '1.5.*'
terraform_wrapper: false
- run: go test -v -cover ./...
env:
Expand All @@ -172,14 +172,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version-file: 'go.mod'
- run: go test -v -cover ./...
```


The following example workflow runs acceptance testing for the provider using the latest patch versions of Go 1.19 and Terraform CLI 0.12 through 1.3:
The following example workflow runs acceptance testing for the provider using the latest patch versions of Go version in the `go.mod` file and Terraform CLI 0.12 through 1.5:

```yaml
name: Terraform Provider Tests
Expand Down Expand Up @@ -210,11 +210,13 @@ jobs:
- '1.1.*'
- '1.2.*'
- '1.3.*'
- '1.4.*'
- '1.5.*'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version-file: 'go.mod'
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform-version }}
Expand All @@ -227,9 +229,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version-file: 'go.mod'
- run: go test -v -cover ./...
```

Expand Down