Merge pull request #886 from arantzaetxebarria/patch-1 #1190
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,zh_Hans] | |
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; 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; fi | |
# if the change involves a link | |
if git diff HEAD^ "locale/${{ matrix.language }}" | grep "http" | grep -q "+" ; then echo "CHK_LINK=true" >> $GITHUB_ENV; fi | |
- name: Install python | |
if: env.PROCESS == 'true' || env.CHK_LINK == 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
if: env.PROCESS == 'true' || env.CHK_LINK == 'true' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
graphviz cmake cpanminus | |
sudo cpanm Text::SimpleTable::AutoWidth | |
pip install -r requirements.txt | |
pip list | |
- name: Configure link checks | |
if: env.PROCESS == 'true' || env.CHK_LINK == 'true' | |
run: | | |
mkdir build | |
cd build | |
cmake -DHTML=ON -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_HANS=ON .. | |
- name: test documentation | |
if: env.PROCESS == 'true' | |
run: | | |
cd build | |
make html-${{ matrix.language }} | |
make presentation-html-${{ matrix.language }} | |
- name: Check Links languages | |
if: env.CHK_LINK == 'true' | |
run: | | |
cd build | |
make linkcheck-${{ matrix.language }} | |