External links checker #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: External links checker | |
on: | |
repository_dispatch: | |
workflow_dispatch: # can also be triggered manually | |
schedule: | |
- cron: "0 0 * * *" # every sunday at midnight | |
jobs: | |
link-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Clone docs repo | |
uses: actions/checkout@v4 | |
with: | |
# place in '/home/runner/work/docs/docs/docs' | |
path: docs # place in a named directory | |
- name: Clone main repo | |
uses: actions/checkout@v4 | |
with: | |
# place in '/home/runner/work/docs/docs/napari' | |
path: napari # place in a named directory | |
repository: napari/napari | |
# ensure version metadata is proper | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache-dependency-path: | | |
napari/pyproject.toml | |
docs/requirements.txt | |
- uses: tlambert03/setup-qt-libs@v1 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install "napari/[all]" | |
env: | |
PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt | |
- name: Run link checker | |
uses: aganders3/headless-gui@v2 | |
env: | |
PIP_CONSTRAINT: ${{ github.workspace }}/napari/resources/constraints/constraints_py3.10_docs.txt | |
with: | |
# Runs in '/home/runner/work/docs/docs/docs' | |
# Built HTML pages in '/home/runner/work/docs/docs/docs/docs/_build/html' | |
run: | | |
python -m pip install -r docs/requirements.txt | |
make -C docs linkcheck-files | |
# skipping setup stops the action from running the default (tiling) window manager | |
# the window manager is not necessary for docs builds at this time and it was causing | |
# problems with screenshots (https://github.com/napari/docs/issues/285) | |
linux-setup: "echo 'skip setup'" | |
linux-teardown: "echo 'skip teardown'" | |
- name: Create issue from file | |
if: ${{ failure() }} | |
uses: peter-evans/create-issue-from-file@v4 | |
with: | |
title: Link Checker Report | |
content-filepath: ./docs/docs/_build/html/output.txt | |
labels: maintenance, task |