From cedc73f416840eb7ef57262bfe7f1e4a35e71e98 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sat, 13 Jan 2024 20:07:44 +0800 Subject: [PATCH] ci: checks markdown for bad links Signed-off-by: Adrian Cole --- .github/workflows/test_markdown.yml | 30 +++++++++++++++++++++++++++++ README.md | 4 ++-- build-bin/README.md | 11 +++++++++-- build-bin/mlc_config.json | 10 ++++++++++ docker/README.md | 2 +- module/README.md | 2 +- 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test_markdown.yml create mode 100644 build-bin/mlc_config.json diff --git a/.github/workflows/test_markdown.yml b/.github/workflows/test_markdown.yml new file mode 100644 index 00000000..9bf1aaeb --- /dev/null +++ b/.github/workflows/test_markdown.yml @@ -0,0 +1,30 @@ +# yamllint --format github .github/workflows/test_markdown.yml +--- +name: test_markdown + +# We test documentation-only commits. +on: + # We run tests on non-tagged pushes to master that aren't a commit made by the release plugin + push: + tags: '' + branches: master + paths: '**/*.md' + # We also run tests on pull requests targeted at the master branch. + pull_request: + branches: master + paths: '**/*.md' + +jobs: + test-markdown: + name: Test Markdown + runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish + if: "!contains(github.event.head_commit.message, 'maven-release-plugin')" + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Check Markdown links + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + check-modified-files-only: 'yes' diff --git a/README.md b/README.md index f97a5246..a0a59294 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Api and all collector components. | Storage | Description | |--------------------------------------------|-----------------------------| -| [Stackdriver Trace](./storage/stackdriver) | Free cloud service provider | +| [Stackdriver Trace](./storage-stackdriver) | Free cloud service provider | ## Server integration In order to integrate with zipkin-server, you need to use properties @@ -79,7 +79,7 @@ $ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo \ If you cannot use our [Docker image](./docker/README.md), you can still integrate yourself by downloading a couple jars. -[Here's an example](autoconfigure/storage-stackdriver#quick-start) of +[Here's an example](module/README.md#quick-start) of integrating Stackdriver storage. ## Troubleshooting diff --git a/build-bin/README.md b/build-bin/README.md index e7989226..27e0e883 100755 --- a/build-bin/README.md +++ b/build-bin/README.md @@ -5,8 +5,15 @@ This is a Maven+Docker project, which uses standard conventions for test and dep The Docker image for zipkin-gcp is a layer over zipkin, including only the [../module] and configuration settings. -[docker-compose-zipkin-gcp.xml] ensures GCP authentication works. It is not run on pull request, as -the required secure variable is only available on master push. +[docker-compose-zipkin-gcp.xml](docker-compose-zipkin-gcp.yml) ensures GCP authentication works. +It is not run on pull request, as the required secure variable is only available on master push. + +[mlc_config.json](mlc_config.json) is run by GitHub Action, but you can also run it locally, +assuming you installed markdown-link-check via NPM. + +```bash +$ find . -name \*.md |xargs markdown-link-check -c ./build-bin/mlc_config.json +``` [//]: # (Below here should be standard for all projects) diff --git a/build-bin/mlc_config.json b/build-bin/mlc_config.json new file mode 100644 index 00000000..969c9aa1 --- /dev/null +++ b/build-bin/mlc_config.json @@ -0,0 +1,10 @@ +{ + "ignorePatterns": [ + { + "pattern": "https://oss.sonatype.org/content/repositories/snapshots" + }, + { + "pattern": "http://localhost:9411/api/v[12]/spans" + } + ] +} \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index ab091145..07f7bbea 100644 --- a/docker/README.md +++ b/docker/README.md @@ -33,7 +33,7 @@ In docker, the following can also be set: ### Stackdriver -Stackdriver Configuration variables are detailed [here](../module/storage-stackdriver#configuration). +Stackdriver Configuration variables are detailed [here](../module/README.md#configuration). ## Building diff --git a/module/README.md b/module/README.md index ae6a98a4..062c4966 100644 --- a/module/README.md +++ b/module/README.md @@ -47,7 +47,7 @@ The Zipkin server can be further configured as described in the Configuration can be applied either through environment variables or an external Zipkin configuration file. The module includes default configuration that can be used as a -[reference](https://github.com/openzipkin/zipkin-gcp/tree/master/autoconfigure/storage-stackdriver/src/main/resources/zipkin-server-stackdriver.yml) +[reference](./src/main/resources/zipkin-server-gcp.yml) for users that prefer a file based approach. #### Environment Variables