Refuse to delete a host config a host is still assigned to #98
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
| name: test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-test: | |
| name: build / vet / fmt / unit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: build | |
| run: go build ./... | |
| - name: vet | |
| run: go vet ./... | |
| - name: gofmt | |
| run: | | |
| out="$(gofmt -l .)" | |
| if [ -n "$out" ]; then echo "gofmt needed on:"; echo "$out"; exit 1; fi | |
| - name: unit tests | |
| # Acceptance (TF_ACC) and live (PCD_LIVE_TEST) tests self-skip here. | |
| run: go test ./internal/... -timeout 120s | |
| lint: | |
| name: golangci-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.12.2 | |
| docs: | |
| name: docs generate (smoke test) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - uses: hashicorp/setup-terraform@v4 | |
| with: | |
| terraform_wrapper: false | |
| # Generated docs are not committed; this verifies tfplugindocs still renders | |
| # cleanly from the schema descriptions (catches broken/missing descriptions). | |
| - name: generate docs | |
| run: go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name pcd --rendered-provider-name PCD | |
| release-config: | |
| name: goreleaser check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| # Validate .goreleaser.yml so release-config drift is caught in PRs, not at | |
| # release time. Must stay in sync with the pinned version in release.yml. | |
| - uses: goreleaser/goreleaser-action@v7 | |
| with: | |
| version: "~> v2.5" | |
| args: check | |
| terraform-fmt: | |
| name: terraform fmt (examples) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: hashicorp/setup-terraform@v4 | |
| with: | |
| terraform_wrapper: false | |
| - run: terraform fmt -check -recursive ./examples |