Fix Broken Links #1131
Workflow file for this run
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: Check Documentation Links | |
on: | |
push: | |
paths: | |
- '.github/workflows/linkcheck.yml' | |
- 'doc/**' | |
- 'locale/**' | |
- 'CMakeLists.txt' | |
branches-ignore: | |
- 'gh-pages' | |
pull_request: | |
paths: | |
- '.github/workflows/doc-check.yml' | |
- 'doc/**' | |
- 'locale/**' | |
- 'CMakeLists.txt' | |
branches-ignore: | |
- 'gh-pages' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [de,en,es,fi,fr,hu,ja,it,nl,pt,sv,tr] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: check modified files | |
id: check_files | |
run: | | |
# allways processing english, no matter what the change was | |
if [[ "${{ matrix.language }}" == "en" ]]; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi | |
# when this file changes all languages are tested | |
if git diff --name-only HEAD^ HEAD | grep -q '.github/workflows/linkcheck.yml' ; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi | |
# when there is a change on the way the build is done all languages are tested | |
if git diff --name-only HEAD^ HEAD | grep -q '^CMakeLists.txt' ; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi | |
if git diff --name-only HEAD^ HEAD | grep -q '^doc/CMakeLists.txt' ; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi | |
if git diff --name-only HEAD^ HEAD | grep -q '^doc/conf.py' ; then echo "PROCESS=true" >> $GITHUB_ENV; exit 0; fi | |
# if there is a change on the translation | |
if git diff --name-only HEAD^ HEAD | grep -q "^locale/${{ matrix.language }}" ; then echo "PROCESS=true" >> $GITHUB_ENV; echo "CHK_LINK=true" >> $GITHUB_ENV; exit 0; fi | |
- name: Install python | |
if: env.PROCESS == 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
if: env.PROCESS == 'true' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
graphviz | |
pip install -r requirements.txt | |
pip list | |
- name: Configure link checks | |
if: env.PROCESS == 'true' | |
run: | | |
mkdir build | |
cd build | |
cmake -DLINKCHECK=ON -DDE=ON -DES=ON -DFI=ON -DFR=ON -DHU=ON -DJA=ON -DIT=ON -DPT=ON -DSV=ON -DTR=ON -DNL=ON -DZH=ON .. | |
- name: Check Links languages | |
if: env.PROCESS == 'true' | |
run: | | |
cd build | |
make linkcheck-${{ matrix.language }} | |