@@ -11,34 +11,77 @@ jobs:
11
11
name : Test
12
12
runs-on : ubuntu-22.04
13
13
steps :
14
+ # Obtención del código
14
15
- uses : actions/checkout@v4
16
+ with :
17
+ submodules : ' true'
18
+ # Necesario para que tj-actions/changed-files se ejecute
19
+ # dentro de un tiempo adecuado
20
+ fetch-depth : 2
21
+
22
+ # Instalación de dependencias
15
23
- name : Preparar Python v3.12
16
24
uses : actions/setup-python@v4
17
25
with :
18
26
python-version : " 3.12"
19
27
cache : " pip"
20
- - name : Sincronizar con CPython
28
+ - name : Configura dpkg/apt para ejecutarse de manera eficiente
29
+ uses : abbbi/github-actions-tune@v1
30
+ - name : Deshabilita triggers de postgresql-common
31
+ run : sudo sed -i '/postgresql-common/d' /var/lib/dpkg/triggers/File
32
+ - name : Instalar dependencias de sistema
21
33
run : |
22
- git submodule update --init --depth=1 cpython
23
- - name : Instalar dependencias
34
+ sudo apt-get install -y hunspell hunspell-es gettext language-pack-es locales-all
35
+ - name : Instalar dependencias de Python
24
36
run : |
25
- sudo apt-get update
26
- sudo apt-get install -y hunspell hunspell-es gettext language-pack-es
27
37
python -m pip install -r requirements.txt
38
+ - name : Listar paquetes y versiones
39
+ run : |
28
40
pip list
29
41
pospell --version
30
42
powrap --version
43
+
44
+ # Cálculo de los archivos .po a verificar.
45
+ # En el caso de un PR, sólo se chequean los .po que se están editando,
46
+ # mientras que en caseo de un push a las ramas 3.* queremos revisar
47
+ # todos los archivos
48
+ - name : Obtiene la lista de archivos .po con cambios (sólo en PRs)
49
+ if : github.event_name == 'pull_request'
50
+ id : changed-po-files
51
+ uses : tj-actions/changed-files@v40
52
+ with :
53
+ files : |
54
+ **/*.po
55
+ - name : Calcula lista de archivos .po a revisar
56
+ id : po-files-to-check
57
+ env :
58
+ PO_FILES_TO_CHECK : ${{ steps.changed-po-files.conclusion == 'skipped' && '**/*.po' || steps.changed-po-files.outputs.all_changed_files }}
59
+ run : |
60
+ echo "po_files_to_check=$PO_FILES_TO_CHECK" >> $GITHUB_OUTPUT
61
+ echo "any_po_files_to_check=`test -n \"$PO_FILES_TO_CHECK\" && echo true || echo false`" >> $GITHUB_OUTPUT
62
+ - name : Muestra outputs de steps anteriores para debugueo
63
+ env :
64
+ CHANGED_PO_FILES : ${{ toJson(steps.changed-po-files) }}
65
+ PO_FILES_TO_CHECK : ${{ toJson(steps.po-files-to-check) }}
66
+ run : |
67
+ echo "steps.changed-po-files=$PO_FILES_TO_CHECK"
68
+ echo "steps.po-files-to-change.$CHANGED_PO_FILES"
69
+
70
+ # Chequeos a realizar
31
71
- name : TRANSLATORS
32
72
run : |
33
73
diff -Naur TRANSLATORS <(LANG=es python scripts/sort.py < TRANSLATORS)
34
74
- name : Powrap
35
- run : powrap --check --quiet **/*.po
75
+ if : steps.po-files-to-check.outputs.any_po_files_to_check == 'true'
76
+ run : powrap --check --quiet ${{ steps.po-files-to-check.outputs.po_files_to_check }}
36
77
- name : Sphinx lint
37
- run : |
38
- sphinx-lint */* .po
78
+ if : steps.po-files-to-check.outputs.any_po_files_to_check == 'true'
79
+ run : sphinx-lint ${{ steps .po-files-to-check.outputs.po_files_to_check }}
39
80
- name : Pospell
40
- run : |
41
- python scripts/check_spell.py
81
+ if : steps.po-files-to-check.outputs.any_po_files_to_check == 'true'
82
+ run : python scripts/check_spell.py ${{ steps.po-files-to-check.outputs.po_files_to_check }}
83
+
84
+ # Construcción de la documentación
42
85
- name : Construir documentación
43
86
run : |
44
87
# FIXME: Relative paths for includes in 'cpython'
0 commit comments