Skip to content

Commit

Permalink
feat(ci): separate linkcheck to standalone workflow
Browse files Browse the repository at this point in the history
The linkcheck is less and less reliable in past weeks. It seems that
some of the sites are broken often, it might be also caused by them
blocking GitHub ranges as such probing might be visible on some of them.

Separating the workflow allows us to execute it only on documentation
changes (we still want to run regular documentation build on all pull
requests to make it required).
  • Loading branch information
nijel committed Sep 30, 2024
1 parent 5f6dc62 commit 4b9a006
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 36 deletions.
37 changes: 1 addition & 36 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later

name: Docs
name: Documentation

on:
push:
Expand Down Expand Up @@ -44,38 +44,3 @@ jobs:
with:
name: Documentation
path: docs/_build/html

linkcheck:
runs-on: ubuntu-24.04
name: Linkcheck

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: astral-sh/setup-uv@v3
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install -y graphviz
- name: Install Python dependencies
run: |
uv pip install --system -r docs/requirements.txt
- name: Sphinx linkcheck
run: |
./ci/run-docs linkcheck
- name: Sphinx linkcheck collect
if: always()
run: |
echo "::add-matcher::.github/matchers/sphinx-linkcheck.json"
echo "::add-matcher::.github/matchers/sphinx-linkcheck-warn.json"
sed 's@^@docs/@' docs/_build/linkcheck/output.txt
echo "::remove-matcher owner=sphinx::"
echo "::remove-matcher owner=sphinx-warn::"
- uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: Linkcheck report
path: docs/_build/linkcheck/output.txt
58 changes: 58 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

name: Linkcheck

on:
push:
paths:
- docs/**.rst
- docs/requirements.txt
- .github/workflows/linkcheck.yml
pull_request:
paths:
- docs/**.rst
- docs/requirements.txt
- .github/workflows/linkcheck.yml
schedule:
- cron: 30 5 * * *

permissions:
contents: read

jobs:
linkcheck:
runs-on: ubuntu-24.04
name: Linkcheck

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: astral-sh/setup-uv@v3
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install -y graphviz
- name: Install Python dependencies
run: |
uv pip install --system -r docs/requirements.txt
- name: Sphinx linkcheck
run: |
./ci/run-docs linkcheck
- name: Sphinx linkcheck collect
if: always()
run: |
echo "::add-matcher::.github/matchers/sphinx-linkcheck.json"
echo "::add-matcher::.github/matchers/sphinx-linkcheck-warn.json"
sed 's@^@docs/@' docs/_build/linkcheck/output.txt
echo "::remove-matcher owner=sphinx::"
echo "::remove-matcher owner=sphinx-warn::"
- uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: Linkcheck report
path: docs/_build/linkcheck/output.txt

0 comments on commit 4b9a006

Please sign in to comment.