Fix goreleaser #122
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
# Terraform Provider testing workflow. | |
name: Tests | |
on: | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'README.md' | |
workflow_dispatch: {} | |
permissions: | |
contents: read | |
concurrency: terraform-provider-smallstep | |
jobs: | |
# Ensure project builds before running testing matrix | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- run: go mod download | |
- run: go build -v . | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
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: | |
name: Terraform Provider Acceptance Tests | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# list whatever Terraform versions here you would like to support | |
# limited to a single version because each team may only have 1 attestation authority | |
terraform: | |
- '1.4.*' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: ${{ matrix.terraform }} | |
terraform_wrapper: false | |
- run: go mod download | |
- env: | |
TF_ACC: "1" | |
SMALLSTEP_API_URL: https://gateway.smallstep.com/api | |
SMALLSTEP_API_TOKEN: ${{ secrets.SMALLSTEP_API_TOKEN }} | |
run: | | |
go test -v -cover ./internal/provider/ -timeout 20m | |
timeout-minutes: 20 | |
sweep: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- run: make sweep | |
env: | |
SWEEP_AGE: 1s | |
TF_ACC: "1" | |
SMALLSTEP_API_URL: https://gateway.smallstep.com/api | |
SMALLSTEP_API_TOKEN: ${{ secrets.SMALLSTEP_API_TOKEN }} |