Skip to content

Commit 4381e31

Browse files
committed
Add docs validation to CI
Signed-off-by: Timo Sand <[email protected]>
1 parent d88848e commit 4381e31

2 files changed

Lines changed: 9 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
cache: true
2626
- run: make tools
2727
- run: make lint
28-
- run: make website-lint
28+
- run: make docs-lint
2929
- run: make build
3030
- run: make test
3131

GNUmakefile

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
TEST?=$$(go list ./... |grep -v 'vendor')
2-
WEBSITE_REPO=github.com/hashicorp/terraform-website
32
PKG_NAME=github
43

54
default: build
65

76
tools:
7+
go install github.com/golangci/misspell/cmd/misspell@latest
88
go install github.com/golangci/golangci-lint/v2/cmd/[email protected]
99
go install github.com/hashicorp/terraform-plugin-docs/cmd/[email protected]
1010

@@ -37,22 +37,10 @@ test-compile:
3737
fi
3838
CGO_ENABLED=0 go test -c $(TEST) $(TESTARGS)
3939

40-
website:
41-
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
42-
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
43-
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
44-
endif
45-
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
46-
47-
website-lint:
48-
@echo "==> Checking website against linters..."
49-
@misspell -error -source=text website/
50-
51-
website-test:
52-
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
53-
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
54-
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
55-
endif
56-
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)
57-
58-
.PHONY: build test testacc fmt fmtcheck lint tools test-compile website website-lint website-test
40+
docs-lint:
41+
@echo "==> Checking docs against linters..."
42+
@misspell -error -source=text docs/
43+
@tfplugindocs validate
44+
45+
46+
.PHONY: build test testacc fmt fmtcheck lint tools test-compile docs-lint

0 commit comments

Comments
 (0)