CI: better link checker

This commit is contained in:
mDuo13
2021-05-19 16:13:49 -07:00
parent 797c845063
commit 871539fd36
2 changed files with 23 additions and 20 deletions

View File

@@ -1,33 +1,26 @@
name: Link Checker name: Link Checker (PR Build)
on: on:
push:
env:
IS_PR: false
pull_request: pull_request:
env: types: [opened, edited, synchronize]
IS_PR: true
jobs: jobs:
build: build:
name: "Build and Check Links"
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v1
with: with:
python-version: ${{ matrix.python-version }} python-version: "3.7"
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install dactyl pip install Jinja2==2.11.3
pip install dactyl lxml
- name: Check for Conflict Markers - name: Check for Conflict Markers
run: | run: |
@@ -35,9 +28,18 @@ jobs:
- name: Build docs - name: Build docs
run: | run: |
echo '{"github_forkurl": "https://github.com/'"${{ github.repository }}"'", "github_branch": "'"${{ github.head_ref }}"'", "github_pr_id": "'"${{ github.event.number }}"'", "is_pr_build": '"${{ IS_PR }}"'}' > dactyl_vars.json echo '{"github_forkurl": "https://github.com/'"${{ github.repository }}"'", "github_branch": "'"${{ github.head_ref }}"'", "github_pr_id": "'"${{ github.event.number }}"'", "is_pr_build": true}' > dactyl_vars.json
tool/build_all_langs.sh --vars dactyl_vars.json tool/build_all_langs.sh --vars dactyl_vars.json
- name: Run Dactyl Link Checker - name: Run Dactyl Link Checker
id: checker
run: | run: |
dactyl_link_checker -q dactyl_link_checker -q > linkreport.txt
sed -i '1,/---------------------------------------/d' linkreport.txt
echo "::set-output name=linkreport::$(cat linkreport.txt)"
- name: Comment Broken Links
uses: unsplash/comment-on-pr@master
with:
msg: ${{steps.checker.outputs.linkreport}}
check_for_duplicate_msg: false

View File

@@ -1,8 +1,9 @@
name: "Dactyl build only on PR" name: "Preview PR builds in the gh-pages branch"
on: # Temporarily disabled: Requires permissions the ripple org doesn't allow
pull_request: # on:
types: [opened, edited, synchronize] # pull_request:
# types: [opened, edited, synchronize]
jobs: jobs:
build: build: