Skip to content

Commit

Permalink
Check README links are alive (#15)
Browse files Browse the repository at this point in the history
Check README links are alive on PR open, merge and after pushing a new
javadoc version to `gh-pages`.
  • Loading branch information
gabrielfeo authored Jan 11, 2023
1 parent d0fa2f3 commit 3ca525e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/publish-javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ defaults:
run:
shell: bash

env:
JAR_NAME: gradle-enterprise-api-kotlin-SNAPSHOT-javadoc.jar

jobs:

build-javadoc:
Expand All @@ -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]
Expand All @@ -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
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/test-readme-links.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3ca525e

Please sign in to comment.