Test translations #46
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: Test translations | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- '**.po' | |
branches: | |
- master | |
push: | |
paths: | |
- '**.po' | |
branches: | |
- master | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
languages: ${{ steps.languages.outputs.languages }} | |
steps: | |
- name: Grab the repo src | |
uses: actions/checkout@v4 | |
- name: List languages | |
id: languages | |
working-directory: locale | |
run: | | |
list=$(find * -maxdepth 0 -type d | sed '/pot/d' | jq -nRc '[inputs]') | |
echo "languages=$list" >> $GITHUB_OUTPUT | |
test-translation: | |
runs-on: ubuntu-latest | |
needs: matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ${{fromJson(needs.matrix.outputs.languages)}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Initialize and update submodule | |
run: | | |
git submodule init | |
git submodule update | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3 | |
cache: 'pip' | |
- name: Install graphviz | |
run: sudo apt-get update && sudo apt-get install -y graphviz | |
- name: Install dependencies | |
run: | | |
pip install -U pip setuptools | |
pip install -r ./requirements.txt | |
- name: Set Sphinx problem matcher | |
uses: sphinx-doc/[email protected] | |
- name: Build translated docs in ${{ matrix.language }} | |
run: | | |
TZ=UTC make html -C sphinx/doc SPHINXOPTS='-W --keep-going -D locale_dirs=$(realpath locale) -D language=${{ matrix.language }}' | |
- name: Set Sphinx Lint problem matcher | |
if: always() | |
uses: rffontenelle/[email protected] | |
- name: Lint translation file | |
if: always() | |
run: sphinx-lint locale/${{ matrix.language }} |