From c41321cf2682838f769f6da87405ed8dc2c0dba5 Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Mon, 19 Feb 2024 23:46:34 +0000 Subject: [PATCH] Add a check to find broken links in docs --- .github/workflows/link-check.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/merge-check.yml | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/link-check.yml diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 0000000000..a28e61ad70 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,29 @@ +name: Check broken links in docs + +on: + pull_request: + branches: + - master + +jobs: + check-broken-links-in-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Restore lychee cache + uses: actions/cache@v3 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Check links in docs/*.md + uses: lycheeverse/lychee-action@v1.9.0 + with: + fail: true + args: --base docs --accept '200,201,202,203,204,429,500' --no-progress --cache --max-cache-age 1d './docs/**/*.md' -- https://users.cecs.anu.edu.au/~steveb/pubs/papers/** + - name: Save lychee cache + uses: actions/cache/save@v3 + if: always() + with: + path: .lycheecache + key: ${{ steps.restore-cache.outputs.cache-primary-key }} diff --git a/.github/workflows/merge-check.yml b/.github/workflows/merge-check.yml index ec5e7735d1..92aeba52d2 100644 --- a/.github/workflows/merge-check.yml +++ b/.github/workflows/merge-check.yml @@ -20,7 +20,7 @@ jobs: # - this action # - minimal tests for stable Rust (we allow them to fail) # - binding tests (it may take long to run) - ignoreActions: "ready-to-merge,check-public-api-changes,minimal-tests-core/x86_64-unknown-linux-gnu/stable,minimal-tests-core/i686-unknown-linux-gnu/stable,minimal-tests-core/x86_64-apple-darwin/stable,v8-binding-test,openjdk-binding-test,jikesrvm-binding-test,julia-binding-test,ruby-binding-test (release),ruby-binding-test (debug)" + ignoreActions: "ready-to-merge,check-broken-links-in-docs,check-public-api-changes,minimal-tests-core/x86_64-unknown-linux-gnu/stable,minimal-tests-core/i686-unknown-linux-gnu/stable,minimal-tests-core/x86_64-apple-darwin/stable,v8-binding-test,openjdk-binding-test,jikesrvm-binding-test,julia-binding-test,ruby-binding-test (release),ruby-binding-test (debug)" # This action uses API. We have a quota of 1000 per hour. checkInterval: 600 env: