Skip to content

Commit e705c94

Browse files
Split linting from main workflow (#144)
Co-authored-by: Stan Ulbrych <stanulbrych@gmail.com>
1 parent 5dff7ef commit e705c94

4 files changed

Lines changed: 68 additions & 52 deletions

File tree

.github/workflows/lint.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: lint
2+
3+
on: # zizmor: ignore[dangerous-triggers]
4+
workflow_run:
5+
workflows: [update and build]
6+
types: [completed]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
version: [3.15, 3.14, 3.13, 3.12, 3.11]
17+
continue-on-error: true
18+
steps:
19+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
20+
with:
21+
python-version: 3
22+
- run: pip install sphinx-lint
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
with:
25+
ref: ${{ matrix.version }}
26+
persist-credentials: false
27+
- uses: rffontenelle/sphinx-lint-problem-matcher@4270bf50b2c93640a7cbb231c09f8e694699af9f # v1.0.0
28+
- run: sphinx-lint
29+
30+
lint-epub:
31+
if: github.event.workflow_run.conclusion == 'success'
32+
runs-on: ubuntu-latest
33+
permissions:
34+
actions: read
35+
strategy:
36+
matrix:
37+
version: [3.15, 3.14]
38+
continue-on-error: true
39+
steps:
40+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
41+
with:
42+
python-version: 3
43+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
44+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
45+
with:
46+
name: build-${{ matrix.version }}-epub
47+
run-id: ${{ github.event.workflow_run.id }}
48+
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
- run: uvx epubcheck

.github/workflows/update-lint-and-build.yml renamed to .github/workflows/update-and-build.yml

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Translation and Linting Workflow
1+
name: update and build
22

33
on:
44
schedule:
@@ -66,31 +66,12 @@ jobs:
6666
if: env.SIGNIFICANT_CHANGES
6767
- name: Push commit
6868
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
69-
if: env.SIGNIFICANT_CHANGES
69+
if: env.SIGNIFICANT_CHANGES && (github.event_name == 'schedule' || github.ref_name
70+
== github.event.repository.default_branch)
7071
with:
7172
branch: ${{ matrix.version }}
7273
github_token: ${{ secrets.GITHUB_TOKEN }}
7374

74-
lint:
75-
runs-on: ubuntu-latest
76-
strategy:
77-
fail-fast: false
78-
matrix:
79-
version: [3.15, 3.14, 3.13, 3.12, 3.11]
80-
needs: [update]
81-
continue-on-error: true
82-
steps:
83-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
84-
with:
85-
python-version: 3
86-
- run: pip install sphinx-lint
87-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
88-
with:
89-
ref: ${{ matrix.version }}
90-
persist-credentials: false
91-
- uses: rffontenelle/sphinx-lint-problem-matcher@4270bf50b2c93640a7cbb231c09f8e694699af9f # v1.0.0
92-
- run: sphinx-lint
93-
9475
build:
9576
runs-on: ubuntu-latest
9677
strategy:
@@ -120,8 +101,10 @@ jobs:
120101
- run: sudo apt-get update && sudo apt-get install -y librsvg2-bin
121102
if: ${{ matrix.format == 'latex' && fromJSON(matrix.version) >= 3.14 }}
122103
- uses: sphinx-doc/github-problem-matcher@1f74d6599f4a5e89a20d3c99aab4e6a70f7bda0f # v1.1
123-
- run: make -e SPHINXOPTS="--color -D language='pl' -W --keep-going" ${{ matrix.format }}
104+
- run: make -e SPHINXOPTS="--color -D language='pl'" ${{ matrix.format }}
124105
working-directory: ./Doc
106+
env:
107+
SPHINXERRORHANDLING: ''
125108
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
126109
if: success() || failure()
127110
with:
@@ -131,6 +114,7 @@ jobs:
131114
output-pdf:
132115
runs-on: ubuntu-latest
133116
strategy:
117+
fail-fast: false
134118
matrix:
135119
version: [3.15, 3.14, 3.13, 3.12, 3.11, '3.10']
136120
needs: [build]
@@ -145,20 +129,3 @@ jobs:
145129
with:
146130
name: build-${{ matrix.version }}-pdf
147131
path: .
148-
149-
lint-epub:
150-
runs-on: ubuntu-latest
151-
strategy:
152-
matrix:
153-
version: [3.15, 3.14]
154-
needs: [build]
155-
continue-on-error: true
156-
steps:
157-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
158-
with:
159-
python-version: 3.x
160-
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
161-
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
162-
with:
163-
name: build-${{ matrix.version }}-epub
164-
- run: uvx epubcheck

README.en.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ core_words, _ = progress_from_resources(list(filter(language_switcher, stats)))
88
total_words, total_strings = progress_from_resources(stats)
99
1010
print(
11-
f'''[![build](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
11+
f'''[![build](https://github.com/python/python-docs-pl/actions/workflows/update-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-and-build.yml)
1212
[![core {core_words:.2f}%](https://img.shields.io/badge/core-{core_words:.2f}%25-0.svg)](https://translations.python.org/#pl)
1313
[![Total Translation of Documentation](https://img.shields.io/badge/total_words-{total_words:.2f}%25-0.svg)](https://translations.python.org/#pl)
1414
[![Total Translation of Documentation](https://img.shields.io/badge/total_strings-{total_strings:.2f}%25-0.svg)](https://translations.python.org/#pl)
15-
[![lint errors count](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=lint%20errors)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
15+
[![lint errors count](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=lint%20errors)](https://github.com/python/python-docs-pl/actions/workflows/lint.yml)
1616
''')
1717
]]] -->
18-
[![build](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
18+
[![build](https://github.com/python/python-docs-pl/actions/workflows/update-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-and-build.yml)
1919
[![core 100.00%](https://img.shields.io/badge/core-100.00%25-0.svg)](https://translations.python.org/#pl)
2020
[![Total Translation of Documentation](https://img.shields.io/badge/total_words-5.71%25-0.svg)](https://translations.python.org/#pl)
21-
[![Total Translation of Documentation](https://img.shields.io/badge/total_strings-12.48%25-0.svg)](https://translations.python.org/#pl)
22-
[![lint errors count](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=lint%20errors)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
21+
[![Total Translation of Documentation](https://img.shields.io/badge/total_strings-12.49%25-0.svg)](https://translations.python.org/#pl)
22+
[![lint errors count](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=lint%20errors)](https://github.com/python/python-docs-pl/actions/workflows/lint.yml)
2323

2424
<!-- [[[end]]] -->
2525

@@ -55,7 +55,6 @@ The documentation at https://docs.python.org/pl/ is updated around once daily.
5555

5656
* [Discord Python Polska #dokumentacja](https://discord.gg/QB3h2Sxc)
5757
* [Python Documentation Community](https://docs-community.readthedocs.io/)
58-
* [Python translations mailing list](https://mail.python.org/mailman3/lists/translation.python.org/)
5958
* [Python Documentation Special Interest Group](https://www.python.org/community/sigs/current/doc-sig/)
6059

6160
**Translation progress**
@@ -89,4 +88,5 @@ You signify your acceptance of this agreement by submitting your work for inclus
8988
* [Projects of the Python Packaging Authority](https://hosted.weblate.org/projects/pypa/-/pl/)
9089
* [Scientific Python Translations](https://scientific-python-translations.github.io/)
9190
* [micro:bit translation programme](https://microbit.org/translate/)
91+
* [Sphinx translation](https://www.sphinx-doc.org/en/master/usage/advanced/intl.html#contributing-to-sphinx-reference-translation)
9292
* [Localizing Django](https://docs.djangoproject.com/en/dev/internals/contributing/localizing/)

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ core_words, _ = progress_from_resources(list(filter(language_switcher, stats)))
88
total_words, total_strings = progress_from_resources(stats)
99
1010
print(
11-
f'''[![build](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
11+
f'''[![build](https://github.com/python/python-docs-pl/actions/workflows/update-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-and-build.yml)
1212
[![podstawowe artykuły {core_words:.2f}%](https://img.shields.io/badge/podstawowe_artykuły-{core_words:.2f}%25-0.svg)](https://translations.python.org/#pl)
1313
[![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/całość_słów-{total_words:.2f}%25-0.svg)](https://translations.python.org/#pl)
1414
[![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/całość_napisów-{total_strings:.2f}%25-0.svg)](https://translations.python.org/#pl)
15-
[![liczba błędów lintowania](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=b%C5%82%C4%99dy%20lintowania)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
15+
[![liczba błędów lintowania](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=b%C5%82%C4%99dy%20lintowania)](https://github.com/python/python-docs-pl/actions/workflows/lint.yml)
1616
''')
1717
]]] -->
18-
[![build](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
18+
[![build](https://github.com/python/python-docs-pl/actions/workflows/update-and-build.yml/badge.svg)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
1919
[![podstawowe artykuły 100.00%](https://img.shields.io/badge/podstawowe_artykuły-100.00%25-0.svg)](https://translations.python.org/#pl)
2020
[![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/całość_słów-5.71%25-0.svg)](https://translations.python.org/#pl)
21-
[![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/całość_napisów-12.48%25-0.svg)](https://translations.python.org/#pl)
22-
[![liczba błędów lintowania](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=b%C5%82%C4%99dy%20lintowania)](https://github.com/python/python-docs-pl/actions/workflows/update-lint-and-build.yml)
21+
[![postęp tłumaczenia całości dokumentacji](https://img.shields.io/badge/całość_napisów-12.49%25-0.svg)](https://translations.python.org/#pl)
22+
[![liczba błędów lintowania](https://shields.io/badge/dynamic/xml?url=https%3A%2F%2Ftranslations.python.org%2Fbuild-details.html&query=%2F%2Ftr%5Btd%5B%40data-label%3D%27language%27%20and%20contains%28.%2C%20%27%28pl%29%27%29%5D%5D%20%20%20%2F%2Ftd%5B%40data-label%3D%27lint%27%5D%2Fa%2Ftext()&label=b%C5%82%C4%99dy%20lintowania)](https://github.com/python/python-docs-pl/actions/workflows/lint.yml)
2323

2424
<!-- [[[end]]] -->
2525

@@ -57,7 +57,6 @@ Dokumentacja na https://docs.python.org/pl/ aktualizowana jest około raz dzienn
5757

5858
* [Discord Python Polska #dokumentacja](https://discord.gg/VCyBDGH38e)
5959
* [Python Documentation Community](https://docs-community.readthedocs.io/en/latest/)
60-
* [Python translations mailing list](https://mail.python.org/mailman3/lists/translation.python.org/)
6160
* [Python Documentation Special Interest Group](https://www.python.org/community/sigs/current/doc-sig/)
6261

6362
**Postęp tłumaczenia**
@@ -91,4 +90,5 @@ Wyrażasz akceptację tej umowy przesyłając swoją pracę do włączenia do do
9190
* [projekty Python Packaging Authority](https://hosted.weblate.org/projects/pypa/-/pl/)
9291
* [Scientific Python Translations](https://scientific-python-translations.github.io/)
9392
* [micro:bit translation programme](https://microbit.org/translate/)
93+
* [tłumaczenie Sphinksa](https://www.sphinx-doc.org/en/master/usage/advanced/intl.html#contributing-to-sphinx-reference-translation)
9494
* [Localizing Django](https://docs.djangoproject.com/en/dev/internals/contributing/localizing/)

0 commit comments

Comments
 (0)