Skip to content

Commit

Permalink
DXCDT-271: Add ci step to check that docs are up to date (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught authored Dec 15, 2022
1 parent 7a35f7b commit 2673c23
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
- name: Check out the code
uses: actions/checkout@v3

- name: Check that docs were generated
run: make check-docs

- name: Check for go vulnerabilities
run: make check-vuln

Expand Down
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ $(GO_BIN)/auth0:
#-----------------------------------------------------------------------------------------------------------------------
# Documentation
#-----------------------------------------------------------------------------------------------------------------------
.PHONY: docs-build docs-start docs-clean
.PHONY: docs docs-start docs-clean

docs-build: docs-clean ## Build the documentation
docs: docs-clean ## Build the documentation
@go run ./cmd/build_doc
@mv ./docs/auth0.md ./docs/index.md
@cd docs && bundle install
Expand All @@ -82,7 +82,7 @@ docs-start: ## Start the doc site locally for testing purposes
@cd docs && bundle exec jekyll serve

docs-clean: ## Remove the documentation
@rm ./docs/auth0_*.md
@rm -f ./docs/auth0_*.md

#-----------------------------------------------------------------------------------------------------------------------
# Building & Installing
Expand Down Expand Up @@ -115,6 +115,18 @@ check-vuln: $(GO_BIN)/govulncheck ## Check go vulnerabilities
${call print, "Running govulncheck over project"}
@govulncheck -v ./...

check-docs: ## Check that documentation was generated correctly
${call print, "Checking that documentation was generated correctly"}
@$(MAKE) docs
@if [ -n "$$(git status --porcelain)" ]; \
then \
echo "Rebuilding the documentation resulted in changed files:"; \
echo "$$(git diff)"; \
echo "Please run \`make docs\` to regenerate docs."; \
exit 1; \
fi
@echo "Documentation is generated correctly."

#-----------------------------------------------------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,4 @@ DEPENDENCIES
webrick (~> 1.7)

BUNDLED WITH
2.1.4
2.3.26
2 changes: 1 addition & 1 deletion docs/auth0_quickstarts.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Quickstart support for getting bootstrapped

### Synopsis

Quickstart support for getting bootstrapped.
Step-by-step guides to quickly integrate Auth0 into your application.

### Options

Expand Down

0 comments on commit 2673c23

Please sign in to comment.