Skip to content

Commit 5a75dea

Browse files
committed
Use new miktex image and filter latexmk outputs.
Add fine control what documentation to build. Fixed parent SHA computation.
1 parent d9a5392 commit 5a75dea

9 files changed

Lines changed: 75 additions & 28 deletions

.github/workflows/CompletePipeline.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ on:
123123
required: false
124124
default: 'true'
125125
type: string
126+
documentation_steps:
127+
description: 'Create documentation.'
128+
required: false
129+
default: 'html pages' # none, html, latex, pdf, pages, asset, all
130+
type: string
126131
secrets:
127132
PYPI_TOKEN:
128133
description: "Token for pushing releases to PyPI."
@@ -152,6 +157,7 @@ jobs:
152157
include_list: ${{ inputs.unittest_include_list }}
153158
exclude_list: ${{ inputs.unittest_exclude_list }}
154159
disable_list: ${{ inputs.unittest_disable_list }}
160+
documentation_steps: ${{ inputs.documentation_steps }}
155161

156162
# AppTestingParams:
157163
# uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
@@ -176,6 +182,7 @@ jobs:
176182
include_list: ${{ inputs.unittest_include_list }}
177183
exclude_list: ${{ inputs.unittest_exclude_list }}
178184
disable_list: ${{ inputs.unittest_disable_list }}
185+
documentation_steps: 'none'
179186

180187
VersionCheck:
181188
name: ''
@@ -262,6 +269,7 @@ jobs:
262269
uses: pyTooling/Actions/.github/workflows/CheckCodeQuality.yml@dev
263270
needs:
264271
- UnitTestingParams
272+
- PublishTestResults # artificial dependency to delay start when pipeline has free job resources
265273
with:
266274
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
267275
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
@@ -273,6 +281,7 @@ jobs:
273281
uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@dev
274282
needs:
275283
- UnitTestingParams
284+
- StaticTypeCheck # artificial dependency to delay start when pipeline has free job resources
276285
with:
277286
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
278287
directory: ${{ needs.UnitTestingParams.outputs.package_directory }}

.github/workflows/LaTeXDocumentation.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ on:
3737
description: 'LaTeX root document without *.tex extension.'
3838
required: true
3939
type: string
40+
miktex_image:
41+
description: 'Name of MiKTeX docker image.'
42+
required: false
43+
default: 'pytooling/miktex:sphinx'
44+
type: string
4045
processor:
4146
description: 'Name of the used LaTeX processor.'
4247
required: false
@@ -64,7 +69,7 @@ jobs:
6469
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
6570
continue-on-error: ${{ inputs.can-fail == 'true' }}
6671
container:
67-
image: pytooling/miktex:sphinx
72+
image: ${{ inputs.miktex_image }}
6873
volumes:
6974
- ${{ github.workspace }}/latex:/latex
7075
steps:
@@ -75,19 +80,28 @@ jobs:
7580
path: latex
7681
investigate: 'true'
7782

78-
- name: Debug
83+
- name: Update
7984
run: |
80-
find / -name "texmfapp.ini" | xargs -I {} sh -c 'echo -e "\e[31mPath: {}\e[0m"; cat "{}"' 2>/dev/null
85+
sudo miktex --admin packages update-package-database
86+
sudo miktex --admin packages update
87+
sudo initexmf --admin --update-fndb
8188
8289
- name: Build LaTeX document using 'pytooling/miktex:sphinx'
8390
if: inputs.pdf_artifact != ''
8491
run: |
92+
set -o pipefail
93+
8594
if [[ "${{ inputs.halt-on-error }}" == "true" ]]; then
8695
HALT_ON_ERROR="--halt-on-error"
8796
fi
8897
8998
cd latex
90-
latexmk --${{ inputs.processor }} --interaction=nonstopmode --file-line-error --max-print-line=1000 ${HALT_ON_ERROR} "${{ inputs.document }}.tex"
99+
latexmk \
100+
--${{ inputs.processor }} \
101+
--interaction=nonstopmode \
102+
--file-line-error \
103+
${HALT_ON_ERROR} \
104+
"${{ inputs.document }}.tex" | filter.latexmk.sh
91105
92106
- name: 📤 Upload 'PDF Documentation' artifact
93107
uses: pyTooling/upload-artifact@v7

.github/workflows/Parameters.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ on:
110110
required: false
111111
default: 'macos-15'
112112
type: string
113+
documentation_steps:
114+
description: 'Create documentation.'
115+
required: false
116+
default: 'all' # none, html, latex, pdf, pages, asset, all
117+
type: string
113118
pipeline-delay:
114119
description: 'Slow down this job, to delay the startup of the GitHub Action pipline.'
115120
required: false
@@ -234,9 +239,12 @@ jobs:
234239
from pathlib import Path
235240
from textwrap import dedent
236241
237-
package_namespace = "${{ inputs.package_namespace }}".strip()
238-
package_name = "${{ inputs.package_name }}".strip()
239-
artifact_basename = "${{ steps.variables.outputs.artifact_basename }}"
242+
package_namespace = "${{ inputs.package_namespace }}".strip()
243+
package_name = "${{ inputs.package_name }}".strip()
244+
artifact_basename = "${{ steps.variables.outputs.artifact_basename }}"
245+
documentationSteps = [step for step in "${{ inputs.documentation_steps }}".split(" ") if step != ""]
246+
if "none" in documentationSteps:
247+
documentationSteps = []
240248
241249
artifact_names = {
242250
"unittesting_xml": f"{artifact_basename}-UnitTestReportSummary-XML",
@@ -256,6 +264,15 @@ jobs:
256264
"documentation_latex": f"{artifact_basename}-Documentation-LaTeX",
257265
"documentation_pdf": f"{artifact_basename}-Documentation-PDF",
258266
}
267+
if "html" not in documentationSteps and "all" not in documentationSteps:
268+
print(f"Disabled HTML artifact: {artifact_names["documentation_html"]}")
269+
artifact_names["documentation_html"] = ""
270+
if "latex" not in documentationSteps and "all" not in documentationSteps:
271+
print(f"Disabled LaTeX artifact: {artifact_names["documentation_latex"]}")
272+
artifact_names["documentation_latex"] = ""
273+
if "pdf" not in documentationSteps and "all" not in documentationSteps:
274+
print(f"Disabled PDF artifact: {artifact_names["documentation_pdf"]}")
275+
artifact_names["documentation_pdf"] = ""
259276
260277
print("Artifacts Names ({len(artifact_names)}):")
261278
for id, artifactName in artifact_names.items():

.github/workflows/PrepareJob.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ jobs:
404404
export GH_TOKEN=${{ github.token }}
405405
406406
printf "Read second parent of current SHA (%s) ... " "${{ github.ref }}"
407-
FATHER_SHA=$(git rev-parse ${{ github.ref }}^2)
407+
FATHER_SHA=$(git rev-parse ${{ github.ref }}^2 2> /dev/null)
408408
if [[ $? -ne 0 || "{FATHER_SHA}" == "" ]]; then
409409
printf "${ANSI_LIGHT_RED}[FAILED]${ANSI_NOCOLOR}\n"
410410
printf "${ANSI_LIGHT_RED}Couldn't read second parent (father) of '%s'.${ANSI_NOCOLOR}\n" "${{ github.ref }}^2"

.github/workflows/_Checking_JobTemplates.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
package_name: 'myPackage'
1818
python_version_list: '3.11 3.12 3.13 3.14 pypy-3.11'
1919
disable_list: 'windows-arm:pypy-3.11'
20+
documentation_steps: 'all'
2021

2122
PlatformTestingParams:
2223
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
@@ -25,13 +26,15 @@ jobs:
2526
name: 'Platform'
2627
python_version_list: ''
2728
system_list: 'ubuntu ubuntu-arm windows windows-arm macos mingw64 clang64 ucrt64'
29+
documentation_steps: 'none'
2830

2931
InstallParams:
3032
uses: pyTooling/Actions/.github/workflows/Parameters.yml@dev
3133
with:
3234
package_name: 'myPackage'
3335
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
3436
python_version_list: ''
37+
documentation_steps: ''
3538

3639
UnitTesting:
3740
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@dev
@@ -85,6 +88,7 @@ jobs:
8588
uses: pyTooling/Actions/.github/workflows/CheckCodeQuality.yml@dev
8689
needs:
8790
- UnitTestingParams
91+
- PublishTestResults # artificial dependency to delay start when pipeline has free job resources
8892
with:
8993
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
9094
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
@@ -97,6 +101,7 @@ jobs:
97101
needs:
98102
- ConfigParams
99103
- UnitTestingParams
104+
- StaticTypeCheck # artificial dependency to delay start when pipeline has free job resources
100105
with:
101106
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
102107
directory : ${{ needs.ConfigParams.outputs.package_directory }}

.github/workflows/_Checking_NamespacePackage_Pipeline.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ jobs:
88
NamespacePackage:
99
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@dev
1010
with:
11-
package_namespace: 'myFramework'
12-
package_name: 'Extension'
11+
package_namespace: 'myFramework'
12+
package_name: 'Extension'
1313
unittest_python_version_list: '3.11 3.12 3.13 3.14 pypy-3.11'
14-
bandit: 'true'
15-
pylint: 'true'
16-
codecov: 'true'
17-
codacy: 'true'
18-
dorny: 'true'
19-
cleanup: 'false'
14+
bandit: 'true'
15+
pylint: 'true'
16+
codecov: 'true'
17+
codacy: 'true'
18+
dorny: 'true'
19+
cleanup: 'false'
20+
documentation_steps: 'html latex'
2021
secrets:
2122
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
2223
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/_Checking_SimplePackage_Pipeline.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ jobs:
88
SimplePackage:
99
uses: pyTooling/Actions/.github/workflows/CompletePipeline.yml@dev
1010
with:
11-
package_name: 'myPackage'
11+
package_name: 'myPackage'
1212
unittest_python_version_list: '3.11 3.12 3.13 3.14 pypy-3.11'
13-
bandit: 'true'
14-
pylint: 'true'
15-
codecov: 'true'
16-
codacy: 'true'
17-
dorny: 'true'
18-
cleanup: 'false'
13+
bandit: 'true'
14+
pylint: 'true'
15+
codecov: 'true'
16+
codacy: 'true'
17+
dorny: 'true'
18+
cleanup: 'false'
19+
documentation_steps: 'html latex'
1920
secrets:
2021
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
2122
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

doc/JobTemplate/Documentation/LaTeXDocumentation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LaTeXDocumentation
99
The ``LaTeXDocumentation`` job template downloads an artifact containing a LaTeX document and translates to a PDF file
1010
using MikTeX.
1111

12-
The translation process uses ``latexmk`` for handling multiple passes. The default LaTeX processor is ``xelatex``, but
12+
The translation process uses ``latexmk`` for handling multiple passes. The default LaTeX processor is ``lualatex``, but
1313
can be switched by a parameter.
1414

1515
.. topic:: Features
@@ -86,7 +86,7 @@ Parameter Summary
8686
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
8787
| :ref:`JOBTMPL/LaTeXDocumentation/Input/document` | yes | string | — — — — |
8888
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
89-
| :ref:`JOBTMPL/LaTeXDocumentation/Input/processor` | no | string | ``'xelatex'`` |
89+
| :ref:`JOBTMPL/LaTeXDocumentation/Input/processor` | no | string | ``'lualatex'`` |
9090
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
9191
| :ref:`JOBTMPL/LaTeXDocumentation/Input/pdf_artifact` | no | string | ``''`` |
9292
+---------------------------------------------------------------------+----------+----------+-------------------------------------------------------------------+
@@ -141,7 +141,7 @@ processor
141141

142142
:Type: string
143143
:Required: no
144-
:Default Value: ``'xelatex'``
144+
:Default Value: ``'lualatex'``
145145
:Possible Values: Any supported LaTeX processor supported by MikTeX and ``latexmk``.
146146
:Description: Name of the used LaTeX processor.
147147

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@
130130
latexPreamble = ""
131131

132132
latex_elements = {
133-
"inputenc": "", # Let XeLaTeX handle input encoding
133+
"inputenc": "", # Let LuaLaTeX handle input encoding
134134
"utf8extra": "",
135-
"fontenc": "", # Disable the default T1 font encoding (Essential for XeLaTeX/LuaLaTeX)
135+
"fontenc": "", # Disable the default T1 font encoding (Essential for LuaLaTeX)
136136
"fontpkg": "", # Disable the default TeX font package (Times/Palatino)
137137
"papersize": "a4paper", # The paper size ('letterpaper' or 'a4paper').
138138
#'pointsize': '10pt', # The font size ('10pt', '11pt' or '12pt').

0 commit comments

Comments
 (0)