From 142766501d702ce4fc1ac30e88cd2e07f20bd9fb Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Thu, 12 Jun 2025 09:22:44 +0100 Subject: [PATCH 1/3] Create lint-and-built.yml --- .github/workflows/lint-and-built.yml | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/lint-and-built.yml diff --git a/.github/workflows/lint-and-built.yml b/.github/workflows/lint-and-built.yml new file mode 100644 index 000000000..665b1a0b4 --- /dev/null +++ b/.github/workflows/lint-and-built.yml @@ -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/XX/LC_MESSAGES + - run: git pull + working-directory: ./Doc/locales/XX/LC_MESSAGES + - uses: sphinx-doc/github-problem-matcher@v1.1 + - run: make -e SPHINXOPTS="--color -D language='XX' -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/sphinx-lint-problem-matcher@v1.0.0 + - run: sphinx-lint From 76004763be46e7c87962023664b355fe8c49f433 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Thu, 12 Jun 2025 09:24:46 +0100 Subject: [PATCH 2/3] fixup --- .github/workflows/lint-and-built.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-and-built.yml b/.github/workflows/lint-and-built.yml index 665b1a0b4..48dff5c10 100644 --- a/.github/workflows/lint-and-built.yml +++ b/.github/workflows/lint-and-built.yml @@ -31,11 +31,11 @@ jobs: - uses: actions/checkout@master with: ref: ${{ matrix.version }} - path: Doc/locales/XX/LC_MESSAGES + path: Doc/locales/ja/LC_MESSAGES - run: git pull - working-directory: ./Doc/locales/XX/LC_MESSAGES + working-directory: ./Doc/locales/ja/LC_MESSAGES - uses: sphinx-doc/github-problem-matcher@v1.1 - - run: make -e SPHINXOPTS="--color -D language='XX' -W --keep-going" ${{ matrix.format }} + - run: make -e SPHINXOPTS="--color -D language='ja' -W --keep-going" ${{ matrix.format }} working-directory: ./Doc - uses: actions/upload-artifact@master if: success() || failure() From 9f7e560ef73f42f2eb295538ff4fbdcf57530e9f Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 12 Jun 2025 19:08:30 +0900 Subject: [PATCH 3/3] Apply suggestions from code review --- .github/workflows/lint-and-built.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint-and-built.yml b/.github/workflows/lint-and-built.yml index 48dff5c10..cea2a22da 100644 --- a/.github/workflows/lint-and-built.yml +++ b/.github/workflows/lint-and-built.yml @@ -4,7 +4,7 @@ name: Linting and Building Workflow on: schedule: - - cron: '0 0 * * *' + - cron: '34 12 * * SAT' push: branches: - '*' @@ -16,8 +16,8 @@ jobs: strategy: fail-fast: false matrix: - version: [ '3.14', '3.13', '3.12', '3.11', '3.10', '3.9' ] - format: [ html, latex ] + version: [ '3.14', '3.13' ] + format: [ html, epub ] steps: - uses: actions/setup-python@master with: @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [ '3.14', '3.13', '3.12', '3.11', '3.10', '3.9' ] + version: [ '3.14', '3.13' ] needs: [ 'build-translation' ] steps: - uses: actions/download-artifact@master @@ -66,7 +66,7 @@ jobs: strategy: fail-fast: false matrix: - version: [ '3.14', '3.13', '3.12', '3.11', '3.10', '3.9' ] + version: [ '3.14', '3.13' ] continue-on-error: true steps: - uses: actions/setup-python@master