From b788e4bf48e8f286e088f977e9ea776609f8d110 Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Wed, 21 Feb 2024 10:41:24 -0500 Subject: [PATCH] Testing gha dis is the commit message #2: remove caching install env change version install tfplugindocs install tfplugindocs Add GOBIN env Add GOBIN env Updated version Setting generate-docs workflow only for push action Setting generate-docs workflow for pull_request --- .github/workflows/generate_docs.yml | 24 +++++++++--------------- Makefile | 6 +++--- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/generate_docs.yml b/.github/workflows/generate_docs.yml index 26e435a..2d0d3af 100644 --- a/.github/workflows/generate_docs.yml +++ b/.github/workflows/generate_docs.yml @@ -1,7 +1,7 @@ name: Generate Terraform Plugin Documentation on: - push: + pull_request: branches: - main - stable-* @@ -11,25 +11,19 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Cache Go dependencies - uses: actions/cache@v2 - with: - path: | - ${{ env.GOPATH }}/pkg/mod - key: go-${{ hashFiles('**/*.go') }} - restore-keys: | - go- - - - name: Setup Go - uses: actions/setup-go@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: 1.x + - name: Install dependencies + run: go get . + - name: Install tfplugindocs run: go get github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest + - name: Build + run: go build -v ./... + - name: Generate documentation run: make generatedocs diff --git a/Makefile b/Makefile index 33ca3bc..b732246 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,6 @@ gofmt: gofmt -s -w internal/provider generatedocs: - @echo "==> Formats examples and generates docs..." - terraform fmt -recursive ./examples/ && tfplugindocs generate - + @echo "==> Formatting examples and generating docs..." + terraform fmt -recursive ./examples/ + go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate