From 3ca525e1a5f695c62857edec6e458290c299c95b Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Wed, 11 Jan 2023 17:06:10 +0000 Subject: [PATCH] Check README links are alive (#15) Check README links are alive on PR open, merge and after pushing a new javadoc version to `gh-pages`. --- .github/workflows/pr.yml | 4 ++++ .github/workflows/publish-javadoc.yml | 20 ++++++++----------- .github/workflows/test-readme-links.yml | 26 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/test-readme-links.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e3729c65..b4659030 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -45,6 +45,10 @@ jobs: if: ${{ steps.diff.outputs.all_modified_files }} run: python3 -m unittest discover -bs .github/scripts + readme-links-test: + needs: [choose-dry-runs] + uses: ./.github/workflows/test-readme-links.yml + choose-dry-runs: runs-on: ubuntu-latest outputs: diff --git a/.github/workflows/publish-javadoc.yml b/.github/workflows/publish-javadoc.yml index f1016ae1..dd6936d3 100644 --- a/.github/workflows/publish-javadoc.yml +++ b/.github/workflows/publish-javadoc.yml @@ -20,9 +20,6 @@ defaults: run: shell: bash -env: - JAR_NAME: gradle-enterprise-api-kotlin-SNAPSHOT-javadoc.jar - jobs: build-javadoc: @@ -33,9 +30,9 @@ jobs: - name: Build javadoc uses: ./.github/actions/build with: - tasks: 'javadocJar' - artifact-name: 'javadoc' - path-to-upload: "build/libs/${{ env.JAR_NAME }}" + tasks: 'dokkaHtml' + artifact-name: 'docs' + path-to-upload: "build/dokka/html/**/*" publish-javadoc: needs: [build-javadoc] @@ -45,13 +42,12 @@ jobs: uses: actions/checkout@v3 with: ref: gh-pages - - name: Download javadoc + - name: Delete current javadoc + run: rm -rf docs + - name: Download new javadoc uses: actions/download-artifact@v3 - - name: Unzip javadoc - run: | - rm -rf docs - unzip "javadoc/$JAR_NAME" -d docs - rm -rf javadoc + with: + path: ./ - name: Commit run: | git config user.name github-actions diff --git a/.github/workflows/test-readme-links.yml b/.github/workflows/test-readme-links.yml new file mode 100644 index 00000000..30cbb305 --- /dev/null +++ b/.github/workflows/test-readme-links.yml @@ -0,0 +1,26 @@ +name: 'Check PR' + +on: + push: + branches: + - main + - gh-pages + workflow_call: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + + test-readme-links: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Check README links + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + folder-path: . + max-depth: 1