Skip to content

Commit 7951fbf

Browse files
authored
Build all languages in a single pass. (#58)
1 parent 29c37ae commit 7951fbf

4 files changed

Lines changed: 95 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,33 @@ jobs:
2424
uses: beeware/.github/.github/workflows/pre-commit-run.yml@main
2525
with:
2626
pre-commit-source: "--group pre-commit"
27+
28+
lint:
29+
needs: [ pre-commit ]
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 5
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v6.0.2
35+
with:
36+
fetch-depth: 1
37+
38+
- name: Set up Python
39+
uses: actions/setup-python@v6.2.0
40+
with:
41+
python-version: "3.X"
42+
cache: pip
43+
cache-dependency-path: |
44+
pyproject.toml
45+
.pre-commit-config.yaml
46+
- name: Install system dependencies
47+
run: |
48+
sudo apt-get install aspell aspell-en
49+
- name: Update pip
50+
run: python -m pip install -U pip
51+
52+
- name: Install Tox
53+
run: python -m pip install --group 'tox-uv'
54+
55+
- name: Perform lint checks
56+
run: python -m tox -e docs-lint

.github/workflows/publish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Publish site
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
# Cancel active CI runs for a PR before starting another run
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
defaults:
14+
run:
15+
shell: bash # https://github.com/beeware/briefcase/pull/912
16+
17+
env:
18+
FORCE_COLOR: "1"
19+
20+
jobs:
21+
publish:
22+
name: Build and publish site
23+
permissions:
24+
contents: write
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 5
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v6.0.2
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Set up Python
34+
uses: actions/setup-python@v6.2.0
35+
with:
36+
python-version: "3.X"
37+
cache: pip
38+
cache-dependency-path: |
39+
pyproject.toml
40+
.pre-commit-config.yaml
41+
42+
- name: Update pip
43+
run: python -m pip install -U pip
44+
45+
- name: Install Tox
46+
run: python -m pip install --group 'tox-uv'
47+
48+
- name: Build the site
49+
run: python -m tox -e docs-all
50+
51+
- name: Deploy the built files
52+
uses: JamesIves/github-pages-deploy-action@v4.8.0
53+
with:
54+
folder: _build/html # The folder the action should deploy.
55+
branch: gh-pages # The branch to which the action should deploy.
56+
git-config-name: github-actions[bot]
57+
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com

.readthedocs.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ version: 2
99
build:
1010
os: ubuntu-24.04
1111
tools:
12-
# Docs are always built on Python 3.12. See also the tox config.
13-
python: "3.12"
12+
# Docs are always built on Python 3.13. See also the tox config.
13+
python: "3.13"
1414
jobs:
1515
post_checkout:
1616
- git fetch --unshallow
1717
pre_install:
1818
- python -m pip install --upgrade pip
1919
- python -m pip install --group 'tox-uv'
20-
pre_build:
21-
- python -m tox -e docs-lint
2220
build:
2321
html:
24-
- python -m tox -e docs-$READTHEDOCS_LANGUAGE -- --output=$READTHEDOCS_OUTPUT/html/
22+
- python -m tox -e docs-all -- --output=$READTHEDOCS_OUTPUT/html/

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ envlist = docs-lint,docs-all
55
docs_dir = {tox_root}{/}docs{/}en
66

77
[testenv:docs{,-lint,-translate,-all,-live,-en,-de,-es,-fr,-it,-pt,-zh-cn,-zh-tw}]
8-
# Docs are always built on Python 3.12. See also the RTD config.
9-
base_python = py312
8+
# Docs are always built on Python 3.13. See also the RTD config.
9+
base_python = py313
1010
skip_install = true
1111
passenv =
1212
DEEPL_API_KEY
@@ -18,8 +18,6 @@ commands:
1818
translate : update_machine_translations --soft-fail de es fr it pt zh_CN zh_TW
1919
lint : markdown-checker --dir {[docs]docs_dir} --func check_broken_urls
2020
lint : pyspelling
21-
live : live_serve_en {posargs} --port=8041
22-
all : build_md_translations {posargs} en de es fr it pt zh_CN zh_TW
2321
en : build_md_translations {posargs} en
2422
de : build_md_translations {posargs} de
2523
es : build_md_translations {posargs} es
@@ -28,3 +26,6 @@ commands:
2826
pt : build_md_translations {posargs} pt
2927
zh-cn : build_md_translations {posargs} zh_CN
3028
zh-tw : build_md_translations {posargs} zh_TW
29+
all : build_md_translations {posargs} en de es fr it pt zh_CN zh_TW
30+
serve : python -m http.server -d _build/html 8041
31+
live : live_serve_en {posargs} --port=8041

0 commit comments

Comments
 (0)