-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
188 lines (178 loc) · 6.11 KB
/
Copy pathdocs.yml
File metadata and controls
188 lines (178 loc) · 6.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Documentation
on:
push:
branches-ignore:
- renovate/**
- weblate
- dependabot/**
pull_request:
schedule:
- cron: 30 5 * * *
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
update-autogenerated-docs:
runs-on: ubuntu-24.04
env:
CI_REDIS_HOST: 127.0.0.1
CI_REDIS_PORT: '6379'
CI_DB_PASSWORD: weblate
CI_DB_HOST: 127.0.0.1
CI_DB_PORT: '5432'
CI_SELENIUM: '1'
DJANGO_SETTINGS_MODULE: weblate.settings_test
services:
database:
image: postgres:18.4-alpine@sha256:1b1689b20d16a014a3d195653381cf2caa75a41a92d93b255a9d6ea29fd353aa
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: weblate
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
cache:
image: valkey/valkey:9.1.0-alpine@sha256:a35428eba9043cc0b79dbe54100f0c92784f2de00ad09b01182bfb1c5c83d1bd
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: false
version: 0.11.21
- name: Install apt dependencies
run: sudo ./ci/apt-install
- name: Install Python dependencies
run: ./ci/pip-install latest
- name: Prepare database
run: ./ci/prepare-database
- name: Migrate database
run: uv run --frozen ./manage.py migrate --noinput --traceback
- run: make -C docs update-docs
- name: Prepare maintenance patch
uses: ./.github/actions/auto-commit
# Keep this outside the composite action; pre-commit.ci lite detects the
# top-level post step, and composites expose nested post hooks.
# The condition mirrors pre-commit-ci/lite-action's main.mjs user-PR check.
- name: Commit changes (external PR, pre-commit-ci-lite)
if: github.event_name == 'pull_request' && github.event.sender.type == 'User'
uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
with:
msg: 'docs: Documentation snippets update'
list-languages:
runs-on: ubuntu-24.04
needs:
- update-autogenerated-docs
outputs:
languages: ${{ steps.list.outputs.languages }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Get changed documentation translations
if: github.event_name == 'pull_request'
id: changed-documentation-translations
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
with:
files: docs/locales/**
use_rest_api: true
- name: Check documentation language scope
id: documentation-language-scope
env:
DOCUMENTATION_TRANSLATIONS_CHANGED: ${{ steps.changed-documentation-translations.outputs.any_changed }}
EVENT_NAME: ${{ github.event_name }}
run: |
if [ "$EVENT_NAME" = "pull_request" ] && [ "$DOCUMENTATION_TRANSLATIONS_CHANGED" != "true" ]; then
echo "all_languages=false" >> "$GITHUB_OUTPUT"
else
echo "all_languages=true" >> "$GITHUB_OUTPUT"
fi
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
if: steps.documentation-language-scope.outputs.all_languages == 'true'
with:
enable-cache: false
version: 0.11.21
- name: Set up Python
if: steps.documentation-language-scope.outputs.all_languages == 'true'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- name: List documentation languages
id: list
env:
ALL_LANGUAGES: ${{ steps.documentation-language-scope.outputs.all_languages }}
run: |
if [ "$ALL_LANGUAGES" = "true" ]; then
uv run --no-project scripts/list-documentation-languages.py >>"$GITHUB_OUTPUT"
else
echo 'languages=["en"]' >> "$GITHUB_OUTPUT"
fi
translations:
runs-on: ubuntu-24.04
needs:
- list-languages
name: Sphinx
strategy:
fail-fast: false
matrix:
language: ${{ fromJson(needs.list-languages.outputs.languages) }}
env:
READTHEDOCS_LANGUAGE: ${{ matrix.language }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: false
version: 0.11.21
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install -y graphviz
- name: Install Python dependencies
run: uv sync --only-group docs --frozen
- name: Sphinx build
run: |
. .venv/bin/activate
echo "::add-matcher::.github/matchers/sphinx.json"
./ci/run-docs
echo "::remove-matcher owner=sphinx::"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Documentation ${{ matrix.language }}
path: docs/_build/html
build:
runs-on: ubuntu-slim
name: Sphinx
needs:
- translations
steps:
# This is dependency only job to collect all test results
- run: echo