Skip to content

Merge pull request #29 from platform9/feat/cluster-blueprint #67

Merge pull request #29 from platform9/feat/cluster-blueprint

Merge pull request #29 from platform9/feat/cluster-blueprint #67

Workflow file for this run

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@v4
- uses: actions/setup-go@v5
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@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v7
with:
version: v2.12.2
docs:
name: docs generate (smoke test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: hashicorp/setup-terraform@v3
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
release-config:
name: goreleaser check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
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@v6
with:
version: "~> v2.5"
args: check
terraform-fmt:
name: terraform fmt (examples)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- run: terraform fmt -check -recursive ./examples