From 714cad80865b81739e7a57aeeb7ee64825bcdaf4 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 4 Dec 2020 19:47:25 +0900 Subject: [PATCH 1/2] ci: fix test of website --- .github/workflows/website.yaml | 50 ++++++++++++++++------------------ .markdownlinkcheck.json | 14 ++++++++++ .markdownlint.yml | 22 +++++++++++++++ 3 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 .markdownlinkcheck.json create mode 100644 .markdownlint.yml diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 8e3082af..f27decd5 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -1,38 +1,36 @@ ---- -name: Website +## These checks will be superseded by documentation.yml +## when the provider documentation layout is moved to +## the Terraform Registry layout. +name: Website Checks on: push: branches: - master - - "release/**" + - 'release/**' pull_request: - types: ['opened', 'synchronize'] paths: - - '**.go' - - 'vendor/**' - - '.github/workflows/**' - -env: - GO_VERSION: "1.15" - GOPROXY: https://gocenter.io,https://proxy.golang.org,direct + - .github/workflows/website.yaml + - website/docs/** + - .markdownlint.yml jobs: - test: + markdown-link-check: runs-on: ubuntu-latest - strategy: - fail-fast: true steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + name: markdown-link-check website/docs/**/*.markdown with: - go-version: '1.15' - - run: bash scripts/gogetcookie.sh - - run: | - cat /etc/issue - echo "whoami" && whoami - sudo mkdir -p /go && sudo chown -R $(whoami) /go - export GOPATH="/go" - echo "GOPATH: $GOPATH" - make website-test - - + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.markdownlinkcheck.json' + folder-path: 'website/docs' + file-extension: '.markdown' + markdown-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: avto-dev/markdown-lint@v1 + with: + args: 'website/docs' + config: '.markdownlint.yml' diff --git a/.markdownlinkcheck.json b/.markdownlinkcheck.json new file mode 100644 index 00000000..2ed1b8fd --- /dev/null +++ b/.markdownlinkcheck.json @@ -0,0 +1,14 @@ +{ + "ignorePatterns": [ + ], + "replacementPatterns": [ + { + "pattern": "^/docs/providers/docker/r/(.*).html", + "replacement": "/github/workspace/website/docs/r/$1.html.markdown" + }, + { + "pattern": "^/docs/providers/docker/d/(.*).html", + "replacement": "/github/workspace/website/docs/d/$1.html.markdown" + } + ] +} diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 00000000..96ab10c8 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,22 @@ +# Configuration for markdownlint +# https://github.com/DavidAnson/markdownlint#configuration + +default: true + +# Disabled Rules +# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md + +MD001: false +MD004: false +MD007: false +MD009: false +MD010: false +MD012: false +MD013: false +MD014: false +MD022: false +MD031: false +MD032: false +MD033: false +MD034: false +MD047: false From 942c5143d614b559d3c928710120a40a6197136a Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Sat, 12 Dec 2020 01:28:35 +0900 Subject: [PATCH 2/2] ci: remove unneeded make tasks --- GNUmakefile | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 02da3223..cb6632bc 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,5 @@ TEST?=$$(go list ./... |grep -v 'vendor') GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) -WEBSITE_REPO=github.com/hashicorp/terraform-website PKG_NAME=docker default: build @@ -52,19 +51,5 @@ test-compile: fi go test -c $(TEST) $(TESTARGS) -website: -ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) - echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." - git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO) -endif - @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) - -website-test: -ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) - echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." - git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO) -endif - @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) - -.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website website-test +.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile