Merge pull request #10 from terraform-community-providers/provisioner #32
This file contains 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
name: Tests | |
on: | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
push: | |
branches: [master] | |
paths-ignore: | |
- 'README.md' | |
concurrency: | |
group: test-${{ github.ref }} | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Install deps | |
run: go mod download | |
- name: Build | |
run: go build -v . | |
generate: | |
name: Generated code check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Check generated code | |
run: | | |
go generate ./... | |
git diff --compact-summary --exit-code || \ | |
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1) | |
test: | |
name: Terraform Provider Acceptance Test | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Install terraform | |
uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: 1.4.* | |
terraform_wrapper: false | |
- name: Install deps | |
run: go mod download | |
- name: Test | |
env: | |
TF_ACC: 1 | |
NEON_TOKEN: ${{ secrets.NEON_TOKEN }} | |
run: go test -v -cover ./internal/provider/ | |
timeout-minutes: 10 |