Test Build Workflow #214
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Build Workflow | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| push: | |
| branches: | |
| - "*" | |
| workflow_dispatch: | |
| jobs: | |
| build-translation: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ["3.15"] | |
| format: [html, latex, epub] | |
| steps: | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.12 | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: python/cpython | |
| ref: ${{ matrix.version }} | |
| - run: make venv | |
| working-directory: ./Doc | |
| - name: Resolve translation ref | |
| id: translation-ref | |
| run: | | |
| if git ls-remote --exit-code --heads "https://github.com/${{ github.repository }}.git" "${{ matrix.version }}" >/dev/null; then | |
| echo "ref=${{ matrix.version }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "ref=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ steps.translation-ref.outputs.ref }} | |
| path: Doc/locales/vi/LC_MESSAGES | |
| - run: git pull | |
| working-directory: ./Doc/locales/vi/LC_MESSAGES | |
| - uses: sphinx-doc/github-problem-matcher@v1.1 | |
| - if: matrix.format == 'latex' | |
| run: sudo apt-get update && sudo apt-get install -y librsvg2-bin | |
| - run: make -e SPHINXOPTS="--color -D language='vi' -W --keep-going" ${{ matrix.format }} | |
| working-directory: ./Doc | |
| - uses: actions/upload-artifact@v7 | |
| 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.15"] | |
| needs: ["build-translation"] | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: build-${{ matrix.version }}-latex | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y latexmk texlive-xetex fonts-freefont-otf xindy librsvg2-bin | |
| - name: Convert SVG assets for LaTeX | |
| run: | | |
| shopt -s nullglob | |
| for svg in *.svg; do | |
| rsvg-convert -f pdf -o "${svg%.svg}.pdf" "$svg" | |
| done | |
| perl -0pi -e 's/\{([^{}]+)\}\.svg/\{$1\}.pdf/g' ./*.tex | |
| - run: make | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-${{ matrix.version }}-pdf | |
| path: ./*.pdf |