Skip to content

Add linting workflow #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 12, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/lint-and-built.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# From python-docs-translations/transifex-automations
# Orignals: https://github.com/python-docs-translations/transifex-automations/tree/main/sample-workflows
name: Linting and Building Workflow

on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- '*'
workflow_dispatch:

jobs:
build-translation:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ '3.14', '3.13', '3.12', '3.11', '3.10', '3.9' ]
format: [ html, latex ]
steps:
- uses: actions/setup-python@master
with:
python-version: 3.12 # pinned for Sphinx 3.4.3 to build 3.10
- uses: actions/checkout@master
with:
repository: python/cpython
ref: ${{ matrix.version }}
- run: make venv
working-directory: ./Doc
- uses: actions/checkout@master
with:
ref: ${{ matrix.version }}
path: Doc/locales/ja/LC_MESSAGES
- run: git pull
working-directory: ./Doc/locales/ja/LC_MESSAGES
- uses: sphinx-doc/[email protected]
- run: make -e SPHINXOPTS="--color -D language='ja' -W --keep-going" ${{ matrix.format }}
working-directory: ./Doc
- uses: actions/upload-artifact@master
if: success() || failure()
with:
name: build-${{ matrix.version }}-${{ matrix.format }}
path: Doc/build/${{ matrix.format }}

output-pdf:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ '3.14', '3.13', '3.12', '3.11', '3.10', '3.9' ]
needs: [ 'build-translation' ]
steps:
- uses: actions/download-artifact@master
with:
name: build-${{ matrix.version }}-latex
- run: sudo apt-get update
- run: sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy
- run: make
- uses: actions/upload-artifact@master
with:
name: build-${{ matrix.version }}-pdf
path: .

lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ '3.14', '3.13', '3.12', '3.11', '3.10', '3.9' ]
continue-on-error: true
steps:
- uses: actions/setup-python@master
with:
python-version: 3
- run: pip install sphinx-lint
- uses: actions/checkout@master
with:
ref: ${{ matrix.version }}
- uses: rffontenelle/[email protected]
- run: sphinx-lint