From 2673c23646405996cbc9b1648813b9aabda1dd44 Mon Sep 17 00:00:00 2001 From: Sergiu Ghitea <28300158+sergiught@users.noreply.github.com> Date: Thu, 15 Dec 2022 19:26:58 +0100 Subject: [PATCH] DXCDT-271: Add ci step to check that docs are up to date (#560) --- .github/workflows/go.yml | 3 +++ Makefile | 18 +++++++++++++++--- docs/Gemfile.lock | 2 +- docs/auth0_quickstarts.md | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4674cfb65..ece98c40a 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 diff --git a/Makefile b/Makefile index 8c703574f..43692b51e 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 @@ -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 #----------------------------------------------------------------------------------------------------------------------- diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 60a408a27..1d26fbb1b 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -274,4 +274,4 @@ DEPENDENCIES webrick (~> 1.7) BUNDLED WITH - 2.1.4 + 2.3.26 diff --git a/docs/auth0_quickstarts.md b/docs/auth0_quickstarts.md index 2afbbf00c..0d8c73923 100644 --- a/docs/auth0_quickstarts.md +++ b/docs/auth0_quickstarts.md @@ -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