Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42a750c

Browse files
committed
Playing with it.
1 parent a5e5e61 commit 42a750c

File tree

1 file changed

+58
-67
lines changed

1 file changed

+58
-67
lines changed

.github/workflows/tests.yml

Lines changed: 58 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -11,85 +11,76 @@ on:
1111
- '*.*'
1212

1313
jobs:
14-
pospell:
15-
name: 'Orthographe (pospell)'
14+
Vérifications:
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'
30+
31+
name: ${{ matrix.tool.name }} (${{ matrix.tool.package }})
1632
runs-on: ubuntu-latest
1733
steps:
1834
- uses: actions/checkout@v2
19-
- name: Register pospell problem matcher
35+
- name: Register problem matchers
2036
run: echo "::add-matcher::.github/problem-matchers/pospell.json"
2137
- uses: lots0logs/[email protected]
2238
id: changed_files
2339
with:
2440
token: ${{ secrets.GITHUB_TOKEN }}
25-
- name: Install pospell
41+
- uses: actions/setup-python@v2
42+
with:
43+
python-version: '3.9'
44+
- name: Install ${{ matrix.tool.package }}
2645
run: |
27-
sudo apt-get update
28-
sudo apt-get install -y hunspell hunspell-fr-comprehensive
29-
sudo python3 -m pip install pospell
30-
- name: Run pospell
46+
[ -n "${{ apt_dependencies }}" ] && sudo apt-get update
47+
[ -n "${{ apt_dependencies }}" ] && sudo apt-get install -y ${{ apt_dependencies }}
48+
python -m pip install --upgrade pip setuptools wheel
49+
python -m pip install ${{ matrix.tool.package }}
50+
- name: Run ${{ matrix.tool.package }}
3151
env:
3252
ADDED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.added), ' ') }}
3353
MODIFIED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.modified), ' ') }}
3454
run: |
3555
CHANGED_PO_FILES=$(printf "%s %s\n" "$ADDED_FILES" "$MODIFIED_FILES" | tr ' ' '\n' | grep '.po$')
36-
[ -n "$CHANGED_PO_FILES" ] && pospell -p dict -l fr_FR $CHANGED_PO_FILES
56+
printf "Running on" "$CHANGED_PO_FILES"
57+
[ -n "$CHANGED_PO_FILES" ] && ${{ matrix.tool.command }} $CHANGED_PO_FILES ${{ matrix.tool.command_suffix }}
3758
38-
# powrap:
39-
# name: 'Longueur des lignes (powrap)'
40-
# runs-on: ubuntu-latest
41-
# steps:
42-
# - uses: actions/checkout@v2
43-
# - name: Install powrap
44-
# run: |
45-
# sudo apt-get update
46-
# sudo apt-get install gettext
47-
# sudo python3 -m pip install powrap
48-
# - name: Run powrap
49-
# run: powrap --check --quiet *.po */*.po
50-
#
51-
# padpo:
52-
# name: 'Grammaire (padpo)'
53-
# runs-on: ubuntu-latest
54-
# steps:
55-
# - uses: actions/checkout@v2
56-
# - uses: actions/setup-python@v2
57-
# with:
58-
# python-version: '3.9'
59-
# - name: Install padpo
60-
# run: |
61-
# python3.9 -m venv .venv
62-
# .venv/bin/python -m pip install --upgrade pip setuptools wheel
63-
# .venv/bin/python -m pip install padpo
64-
# - name: Run padpo
65-
# run: PATH=$PATH:$PWD/.venv/bin/ padpo -i *.po */*.po 2>&1 | grep -v -Ff padpo.ignore
66-
#
67-
# sphinx:
68-
# name: 'Génération de la doc (sphinx)'
69-
# runs-on: ubuntu-latest
70-
# steps:
71-
# - uses: actions/checkout@v2
72-
# - uses: actions/cache@v2
73-
# with:
74-
# path: '~/cpython/'
75-
# key: '1'
76-
# - uses: actions/setup-python@v2
77-
# with:
78-
# python-version: '3.9'
79-
# - name: Clone cpython
80-
# run: |
81-
# if [ ! -d ~/cpython ]; then
82-
# git clone https://github.com/python/cpython ~/cpython/
83-
# else
84-
# git -C ~/cpython fetch
85-
# fi
86-
# - name: Prepare build hierarchy
87-
# run: |
88-
# mkdir -p ~/locales/fr/LC_MESSAGES/
89-
# cp -uv --parents *.po */*.po ~/locales/fr/LC_MESSAGES/
90-
# git -C ~/cpython checkout b30934e9afb0af3f8e2e5f0992445be775b3c630
91-
# - name: Prepare venv
92-
# run: make -C $HOME/cpython/Doc venv
93-
# - name: sphinx-build
94-
# run: make -C $HOME/cpython/Doc SPHINXOPTS="-qW -j4 -D locale_dirs=$HOME/locales -D language=fr -D gettext_compact=0" autobuild-dev-html
95-
#
59+
sphinx:
60+
name: 'Génération de la doc (sphinx)'
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v2
64+
- uses: actions/cache@v2
65+
with:
66+
path: '~/cpython/'
67+
key: '1'
68+
- uses: actions/setup-python@v2
69+
with:
70+
python-version: '3.9'
71+
- name: Clone cpython
72+
run: |
73+
if [ ! -d ~/cpython ]; then
74+
git clone https://github.com/python/cpython ~/cpython/
75+
else
76+
git -C ~/cpython fetch
77+
fi
78+
- name: Prepare build hierarchy
79+
run: |
80+
mkdir -p ~/locales/fr/LC_MESSAGES/
81+
cp -uv --parents *.po */*.po ~/locales/fr/LC_MESSAGES/
82+
git -C ~/cpython checkout b30934e9afb0af3f8e2e5f0992445be775b3c630
83+
- name: Prepare venv
84+
run: make -C $HOME/cpython/Doc venv
85+
- name: sphinx-build
86+
run: make -C $HOME/cpython/Doc SPHINXOPTS="-qW -j4 -D locale_dirs=$HOME/locales -D language=fr -D gettext_compact=0" autobuild-dev-html

0 commit comments

Comments
 (0)