Skip to content

Commit 6b0c1eb

Browse files
Add linting workflow (#45)
1 parent 35ae7ef commit 6b0c1eb

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/lint-and-built.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# From python-docs-translations/transifex-automations
2+
# Orignals: https://github.com/python-docs-translations/transifex-automations/tree/main/sample-workflows
3+
name: Linting and Building Workflow
4+
5+
on:
6+
schedule:
7+
- cron: '34 12 * * SAT'
8+
push:
9+
branches:
10+
- '*'
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-translation:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
version: [ '3.14', '3.13' ]
20+
format: [ html, epub ]
21+
steps:
22+
- uses: actions/setup-python@master
23+
with:
24+
python-version: 3.12 # pinned for Sphinx 3.4.3 to build 3.10
25+
- uses: actions/checkout@master
26+
with:
27+
repository: python/cpython
28+
ref: ${{ matrix.version }}
29+
- run: make venv
30+
working-directory: ./Doc
31+
- uses: actions/checkout@master
32+
with:
33+
ref: ${{ matrix.version }}
34+
path: Doc/locales/ja/LC_MESSAGES
35+
- run: git pull
36+
working-directory: ./Doc/locales/ja/LC_MESSAGES
37+
- uses: sphinx-doc/[email protected]
38+
- run: make -e SPHINXOPTS="--color -D language='ja' -W --keep-going" ${{ matrix.format }}
39+
working-directory: ./Doc
40+
- uses: actions/upload-artifact@master
41+
if: success() || failure()
42+
with:
43+
name: build-${{ matrix.version }}-${{ matrix.format }}
44+
path: Doc/build/${{ matrix.format }}
45+
46+
output-pdf:
47+
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
version: [ '3.14', '3.13' ]
51+
needs: [ 'build-translation' ]
52+
steps:
53+
- uses: actions/download-artifact@master
54+
with:
55+
name: build-${{ matrix.version }}-latex
56+
- run: sudo apt-get update
57+
- run: sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy
58+
- run: make
59+
- uses: actions/upload-artifact@master
60+
with:
61+
name: build-${{ matrix.version }}-pdf
62+
path: .
63+
64+
lint:
65+
runs-on: ubuntu-latest
66+
strategy:
67+
fail-fast: false
68+
matrix:
69+
version: [ '3.14', '3.13' ]
70+
continue-on-error: true
71+
steps:
72+
- uses: actions/setup-python@master
73+
with:
74+
python-version: 3
75+
- run: pip install sphinx-lint
76+
- uses: actions/checkout@master
77+
with:
78+
ref: ${{ matrix.version }}
79+
- uses: rffontenelle/[email protected]
80+
- run: sphinx-lint

0 commit comments

Comments
 (0)