Debian Codegraph @

.github/workflows/tests.yml

raw
1 name: Tests
2
3 on: [push, pull_request, workflow_dispatch]
4
5 permissions: {}
6
7 env:
8 FORCE_COLOR: 1
9
10 jobs:
11 build_doc:
12 name: Build CPython docs
13 runs-on: ubuntu-latest
14 strategy:
15 fail-fast: false
16 matrix:
17 python-version: ["3.15", "3.14", "3.13", "3.12"]
18 include:
19 - python-version: "3.15"
20 branch: "main"
21 steps:
22 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
23 with:
24 persist-credentials: false
25 - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
26 with:
27 python-version: ${{ matrix.python-version }}
28 allow-prereleases: true
29 cache: pip
30 - name: Clone docsbuild scripts
31 run: |
32 git clone https://github.com/python/docsbuild-scripts/
33 - name: Set up requirements
34 run: |
35 python -m pip install --upgrade pip
36 python -m pip install -r docsbuild-scripts/requirements.txt
37 - name: Build documentation
38 run: >
39 python ./docsbuild-scripts/build_docs.py
40 --quick
41 --build-root ./build_root
42 --www-root ./www
43 --log-directory ./logs
44 --group "$(id -g)"
45 --skip-cache-invalidation
46 --theme "$(pwd)"
47 --languages en
48 --branches ${{ matrix.branch || matrix.python-version }}
49 ${{ matrix.branch == 'main' && '--select-output no-html' || '' }}
50 - name: Show logs
51 if: failure()
52 run: |
53 cat ./logs/docsbuild.log
54 - name: Upload
55 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
56 with:
57 name: doc-html-${{ matrix.python-version }}
58 path: www/
59
60 translations:
61 runs-on: ${{ matrix.os }}
62 strategy:
63 fail-fast: false
64 matrix:
65 os: ["ubuntu-latest", "windows-latest"]
66 # Test minimum supported and latest stable from 3.x series
67 python-version: ["3.12", "3"]
68 steps:
69 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
70 with:
71 persist-credentials: false
72 - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
73 with:
74 python-version: ${{ matrix.python-version }}
75 allow-prereleases: true
76 cache: pip
77 - name: Install dependencies
78 run: |
79 pip install --upgrade pip
80 pip install -r requirements.txt
81 - name: Remove locale file for testing
82 shell: bash
83 run: rm -rf python_docs_theme/locale/pt_BR/
84 - run: python babel_runner.py extract
85 - run: python babel_runner.py init -l pt_BR
86 - run: python babel_runner.py update
87 - run: python babel_runner.py update -l pt_BR
88 - run: python babel_runner.py compile
89 - run: python babel_runner.py compile -l pt_BR
90 - name: Print .pot file
91 shell: bash
92 run: cat python_docs_theme/locale/python-docs-theme.pot
93 - name: Print .po file
94 shell: bash
95 run: cat python_docs_theme/locale/pt_BR/LC_MESSAGES/python-docs-theme.po