Skip to content

Commit

Permalink
Testing gha
Browse files Browse the repository at this point in the history
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
  • Loading branch information
GomathiselviS committed Feb 21, 2024
1 parent 9c1ffe7 commit b788e4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Generate Terraform Plugin Documentation

on:
push:
pull_request:
branches:
- main
- stable-*
Expand All @@ -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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b788e4b

Please sign in to comment.