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

Skip to content

Commit f7ae379

Browse files
authored
Workaround Python upgrades and venv caching. (#1504)
1 parent 92afc86 commit f7ae379

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

.github/workflows/tests.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ jobs:
1818
- name: Orthographe
1919
package: pospell
2020
apt_dependencies: hunspell hunspell-fr-comprehensive
21-
command: pospell -p dict -l fr_FR
21+
command: 'pospell -p dict -l fr_FR $CHANGED_PO_FILES'
2222
- name: Longueur des lignes
2323
package: powrap
2424
apt_dependencies: gettext
25-
command: powrap --check --quiet --diff
25+
command: 'powrap --check --quiet --diff $CHANGED_PO_FILES'
2626
- name: Grammaire
2727
package: padpo
28-
command: 'padpo -i 2>&1'
29-
command_suffix: '| grep -v -Ff padpo.ignore'
28+
command: 'padpo -i $CHANGED_PO_FILES 2>&1 | grep -v -Ff padpo.ignore'
3029

3130
name: ${{ matrix.tool.name }} (${{ matrix.tool.package }})
3231
runs-on: ubuntu-latest
@@ -51,9 +50,14 @@ jobs:
5150
ADDED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.added), ' ') }}
5251
MODIFIED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.modified), ' ') }}
5352
run: |
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 }}
53+
CHANGED_PO_FILES=$(printf "%s %s\n" "$ADDED_FILES" "$MODIFIED_FILES" | tr ' ' '\n' | grep '.po$'; true)
54+
if [ -n "$CHANGED_PO_FILES" ]
55+
then
56+
echo "Running on:" $CHANGED_PO_FILES
57+
${{ matrix.tool.command }}
58+
else
59+
echo "No changed po files, nothing to check."
60+
fi
5761
5862
sphinx:
5963
name: 'Génération de la doc (sphinx)'
@@ -81,6 +85,10 @@ jobs:
8185
cp -uv --parents *.po */*.po ~/locales/fr/LC_MESSAGES/
8286
git -C ~/cpython checkout b30934e9afb0af3f8e2e5f0992445be775b3c630
8387
- name: Prepare venv
84-
run: make -C $HOME/cpython/Doc venv
88+
run: |
89+
# If the venv exists but is broken, drop it (happens on Python upgrades):
90+
# see https://github.com/actions/setup-python/issues/170
91+
[ -d $HOME/cpython/Doc/venv/bin/ -a ! -e $HOME/cpython/Doc/venv/bin/python ] && rm -fr $HOME/cpython/Doc/venv
92+
make -C $HOME/cpython/Doc venv
8593
- name: sphinx-build
8694
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)