From b27d7d27fd160fb9d0c3c8c223d41374fbb96325 Mon Sep 17 00:00:00 2001 From: ti-srebot <66930949+ti-srebot@users.noreply.github.com> Date: Mon, 7 Sep 2020 15:50:03 +0800 Subject: [PATCH] *: check link via GitHub action (#353) (#357) * cherry pick #353 to release-2.0 Signed-off-by: ti-srebot * Update ci.yaml Co-authored-by: Xuecheng Zhang Co-authored-by: yikeke --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/link-check.yaml | 37 +++++++++++++++++++++++++++++++ en/maintain-dm-using-tiup.md | 2 +- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/link-check.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 802883bfe..12e60d5e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: with: config: './.markdownlint.yaml' args: '.' - - name: Verify links + - name: Verify internal links run: ./hack/verify-links.sh - - name: Verify link anchors + - name: Verify internal link anchors run: ./hack/verify-link-anchors.sh diff --git a/.github/workflows/link-check.yaml b/.github/workflows/link-check.yaml new file mode 100644 index 000000000..e56226a70 --- /dev/null +++ b/.github/workflows/link-check.yaml @@ -0,0 +1,37 @@ +name: external-link-check + +on: [pull_request] + +jobs: + base: + runs-on: ubuntu-18.04 + steps: + - name: Check out code + uses: actions/checkout@v2 + + # NOTE: + # - the check process can be very fast, + # but if `-c` is too large then `Too Many Requests (HTTP error 429)` may be reported from `https://github.com/*`. + # - we hardcode `--document-root` to `/github/workspace` in the container now. + # - we use `http://172.*` as sample addresses in some docs, so we need to exclude them. + - name: Check external links in zh files + uses: peter-evans/link-checker@v1 + with: + args: -c 32 -d /github/workspace -r -x "http://172.*|https://github.com/pingcap/dm/pull/.*|.*.md" zh* + + - name: Check external links in en files + id: lc + uses: peter-evans/link-checker@v1 + with: + args: -c 32 -d /github/workspace -r -x "http://172.*|https://github.com/pingcap/dm/pull/.*|.*.md" en* + + - name: Fail if there were external link errors + if: ${{ steps.lc.outputs.exit_code }} + run: | + echo "Please check the broken links reported in previous steps \"Check external links in zh files\" and \"Check external links in en files\"." + exit ${{ steps.lc.outputs.exit_code }} + + # Debug via SSH if previous steps failed + #- name: Set up tmate session + # if: ${{ failure() }} + # uses: mxschmitt/action-tmate@v2 diff --git a/en/maintain-dm-using-tiup.md b/en/maintain-dm-using-tiup.md index 2c64261d5..b0ce082e3 100644 --- a/en/maintain-dm-using-tiup.md +++ b/en/maintain-dm-using-tiup.md @@ -265,7 +265,7 @@ Execute `tiup list dm-master` to view the latest cluster version supported by Ti The process of using the `import` command is as follows: -1. TiUP generates a topology file [`topology.yml`](https://github.com/pingcap/tiup/blob/master/examples/topology.dm.example.yaml) based on the DM cluster previously deployed using DM-Ansible. +1. TiUP generates a topology file [`topology.yml`](https://github.com/pingcap/tiup/blob/master/examples/dm/topology.example.yaml) based on the DM cluster previously deployed using DM-Ansible. 2. After confirming that the topology file has been generated, you can use it to deploy the DM cluster of v2.0 or later versions. After the deployment is completed, you can execute the `tiup dm start` command to start the cluster and begin the process of upgrading the DM kernel.