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

Skip to content

Commit 4975c68

Browse files
authored
Github checks only changed files (#1500)
1 parent 02264af commit 4975c68

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

.github/workflows/tests.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,49 @@ on:
1111
- '*.*'
1212

1313
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'
2830

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 }})
4432
runs-on: ubuntu-latest
4533
steps:
4634
- 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 }}
4741
- uses: actions/setup-python@v2
4842
with:
4943
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), ' ') }}
5153
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 }}
5757
5858
sphinx:
5959
name: 'Génération de la doc (sphinx)'

library/aifc.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ msgstr ""
66
"Project-Id-Version: Python 3\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2020-10-01 16:00+0200\n"
9-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9+
"PO-Revision-Date: 2020-12-11 15:56+0100\n"
10+
"Last-Translator: Julien Palard <[email protected]>\n"
1111
"Language-Team: FRENCH <[email protected]>\n"
1212
"Language: fr\n"
1313
"MIME-Version: 1.0\n"

library/allos.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ msgstr ""
66
"Project-Id-Version: Python 3\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2020-08-24 09:01+0200\n"
9-
"PO-Revision-Date: 2018-07-27 22:58+0200\n"
10-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9+
"PO-Revision-Date: 2020-12-11 15:56+0100\n"
10+
"Last-Translator: Julien Palard <[email protected]>\n"
1111
"Language-Team: FRENCH <[email protected]>\n"
1212
"Language: fr\n"
1313
"MIME-Version: 1.0\n"

library/zoneinfo.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ msgstr ""
66
"Project-Id-Version: Python 3\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2020-08-24 09:01+0200\n"
9-
"PO-Revision-Date: 2020-07-20 15:07+0200\n"
10-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9+
"PO-Revision-Date: 2020-12-11 15:55+0100\n"
10+
"Last-Translator: Julien Palard <[email protected]>\n"
1111
"Language-Team: FRENCH <[email protected]>\n"
1212
"Language: fr\n"
1313
"MIME-Version: 1.0\n"

0 commit comments

Comments
 (0)