|
11 | 11 | - '*.*'
|
12 | 12 |
|
13 | 13 | jobs:
|
14 |
| - pospell: |
15 |
| - name: 'Orthographe (pospell)' |
16 |
| - runs-on: ubuntu-latest |
17 |
| - steps: |
18 |
| - - uses: actions/checkout@v2 |
19 |
| - - name: Register pospell problem matcher |
20 |
| - run: echo "::add-matcher::.github/problem-matchers/pospell.json" |
21 |
| - - name: Install pospell |
22 |
| - run: | |
23 |
| - sudo apt-get update |
24 |
| - sudo apt-get install -y hunspell hunspell-fr-comprehensive |
25 |
| - sudo python3 -m pip install pospell |
26 |
| - - name: Run pospell |
27 |
| - run: pospell -p dict -l fr_FR *.po */*.po |
| 14 | + checks: |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + tool: |
| 18 | + - name: Orthographe |
| 19 | + package: pospell |
| 20 | + apt_dependencies: hunspell hunspell-fr-comprehensive |
| 21 | + command: pospell -p dict -l fr_FR |
| 22 | + - name: Longueur des lignes |
| 23 | + package: powrap |
| 24 | + apt_dependencies: gettext |
| 25 | + command: powrap --check --quiet --diff |
| 26 | + - name: Grammaire |
| 27 | + package: padpo |
| 28 | + command: 'padpo -i 2>&1' |
| 29 | + command_suffix: '| grep -v -Ff padpo.ignore' |
28 | 30 |
|
29 |
| - powrap: |
30 |
| - name: 'Longueur des lignes (powrap)' |
31 |
| - runs-on: ubuntu-latest |
32 |
| - steps: |
33 |
| - - uses: actions/checkout@v2 |
34 |
| - - name: Install powrap |
35 |
| - run: | |
36 |
| - sudo apt-get update |
37 |
| - sudo apt-get install gettext |
38 |
| - sudo python3 -m pip install powrap |
39 |
| - - name: Run powrap |
40 |
| - run: powrap --check --quiet *.po */*.po |
41 |
| - |
42 |
| - padpo: |
43 |
| - name: 'Grammaire (padpo)' |
| 31 | + name: ${{ matrix.tool.name }} (${{ matrix.tool.package }}) |
44 | 32 | runs-on: ubuntu-latest
|
45 | 33 | steps:
|
46 | 34 | - uses: actions/checkout@v2
|
| 35 | + - name: Register problem matchers |
| 36 | + run: echo "::add-matcher::.github/problem-matchers/pospell.json" |
| 37 | + - uses: lots0logs/[email protected] |
| 38 | + id: changed_files |
| 39 | + with: |
| 40 | + token: ${{ secrets.GITHUB_TOKEN }} |
47 | 41 | - uses: actions/setup-python@v2
|
48 | 42 | with:
|
49 | 43 | python-version: '3.9'
|
50 |
| - - name: Install padpo |
| 44 | + - name: Install ${{ matrix.tool.package }} |
| 45 | + run: | |
| 46 | + [ -n "${{ matrix.tool.apt_dependencies }}" ] && sudo apt-get update && sudo apt-get install -y ${{ matrix.tool.apt_dependencies }} |
| 47 | + python -m pip install --upgrade pip setuptools wheel |
| 48 | + python -m pip install ${{ matrix.tool.package }} |
| 49 | + - name: Run ${{ matrix.tool.package }} |
| 50 | + env: |
| 51 | + ADDED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.added), ' ') }} |
| 52 | + MODIFIED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.modified), ' ') }} |
51 | 53 | run: |
|
52 |
| - python3.9 -m venv .venv |
53 |
| - .venv/bin/python -m pip install --upgrade pip setuptools wheel |
54 |
| - .venv/bin/python -m pip install padpo |
55 |
| - - name: Run padpo |
56 |
| - run: PATH=$PATH:$PWD/.venv/bin/ padpo -i *.po */*.po 2>&1 | grep -v -Ff padpo.ignore |
| 54 | + CHANGED_PO_FILES=$(printf "%s %s\n" "$ADDED_FILES" "$MODIFIED_FILES" | tr ' ' '\n' | grep '.po$') |
| 55 | + echo "Running on:" $CHANGED_PO_FILES |
| 56 | + [ -n "$CHANGED_PO_FILES" ] && ${{ matrix.tool.command }} $CHANGED_PO_FILES ${{ matrix.tool.command_suffix }} |
57 | 57 |
|
58 | 58 | sphinx:
|
59 | 59 | name: 'Génération de la doc (sphinx)'
|
|
0 commit comments