|
# Adapted from python-docs-translations/transifex-automations |
|
# Originals (reviewed at f7ac74cc364ac066273d13755e9943db13f49206): |
|
# https://github.com/python-docs-translations/transifex-automations/blob/main/sample-workflows/po-lint.yml |
|
# https://github.com/python-docs-translations/transifex-automations/blob/main/sample-workflows/test-build.yml |
|
name: Linting and Building Workflow |
|
|
|
on: |
|
schedule: |
|
- cron: '34 12 * * SAT' |
|
push: |
|
branches: |
|
- '3.15' |
|
workflow_dispatch: |
|
|
|
permissions: |
|
contents: read |
|
|
|
env: |
|
CPYTHON_BRANCH: '3.15' |
|
|
|
jobs: |
|
build-translation: |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: Set up Python |
|
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
|
with: |
|
python-version: ${{ env.CPYTHON_BRANCH }} |
|
allow-prereleases: true |
|
- name: Check out CPython |
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
with: |
|
repository: python/cpython |
|
ref: ${{ env.CPYTHON_BRANCH }} |
|
persist-credentials: false |
|
- name: Install uv for CPython's locked documentation dependencies |
|
run: python -m pip install uv |
|
- name: Create documentation environment |
|
run: make venv PYTHON=python |
|
working-directory: ./Doc |
|
- name: Check out translations |
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
with: |
|
# Check the triggering commit when it belongs to this version. |
|
ref: ${{ env.CPYTHON_BRANCH == github.ref_name && github.sha || env.CPYTHON_BRANCH }} |
|
path: Doc/locales/ja/LC_MESSAGES |
|
persist-credentials: false |
|
- uses: sphinx-doc/github-problem-matcher@1f74d6599f4a5e89a20d3c99aab4e6a70f7bda0f # v1.1 |
|
- name: Build Japanese documentation |
|
run: make -e SPHINXOPTS="--color -D language=ja -W --keep-going" html |
|
working-directory: ./Doc |
|
- name: Upload documentation |
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 |
|
if: success() || failure() |
|
with: |
|
name: build-${{ env.CPYTHON_BRANCH }}-html |
|
path: Doc/build/html |
|
|
|
lint: |
|
runs-on: ubuntu-latest |
|
continue-on-error: true |
|
steps: |
|
- name: Set up Python |
|
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 |
|
with: |
|
python-version: ${{ env.CPYTHON_BRANCH }} |
|
allow-prereleases: true |
|
- name: Install sphinx-lint |
|
run: python -m pip install sphinx-lint |
|
- name: Check out translations |
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
with: |
|
ref: ${{ env.CPYTHON_BRANCH == github.ref_name && github.sha || env.CPYTHON_BRANCH }} |
|
persist-credentials: false |
|
- uses: rffontenelle/sphinx-lint-problem-matcher@4270bf50b2c93640a7cbb231c09f8e694699af9f # v1.0.0 |
|
- run: sphinx-lint |