-
-
Notifications
You must be signed in to change notification settings - Fork 15
78 lines (69 loc) · 1.98 KB
/
test-translations.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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: locales
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: Place locales directory in Sphinx doc
run: cp -a locales sphinx/doc/
- 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 language=${{ matrix.language }}'
- name: Set Sphinx Lint problem matcher
if: always()
uses: rffontenelle/[email protected]
- name: Lint translation file
if: always()
run: cd locales/${{ matrix.language }}/LC_MESSAGES && sphinx-lint