|
# 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: '34 12 * * SAT' |
|
push: |
|
branches: |
|
- '*' |
|
workflow_dispatch: |
|
|
|
permissions: |
|
contents: read |
|
|
|
jobs: |
|
build-translation: |
|
runs-on: ubuntu-latest |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
version: [ '3.14', '3.13' ] |
|
format: [ html ] |
|
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/github-problem-matcher@v1.1 |
|
- 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 }} |
|
|
|
lint: |
|
runs-on: ubuntu-latest |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
version: [ '3.14', '3.13' ] |
|
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/sphinx-lint-problem-matcher@v1.0.0 |
|
- run: sphinx-lint |