Skip to content

Merge pull request #806 from osgeoweblate/weblate-osgeolive-index #963

Merge pull request #806 from osgeoweblate/weblate-osgeolive-index

Merge pull request #806 from osgeoweblate/weblate-osgeolive-index #963

Workflow file for this run

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@v3
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@v4
with:
python-version: '3.x'
- name: Install dependencies
if: env.PROCESS == 'true'
run: |
sudo apt-get update
sudo apt-get install -y \
graphviz
python -m pip install --upgrade pip
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 }}