Repository navigation
Expand file tree
/
Copy pathswitcher-requirements-progress.yml
More file actions
71 lines (60 loc) · 1.96 KB
/
Copy pathswitcher-requirements-progress.yml
File metadata and controls
71 lines (60 loc) · 1.96 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
name: Check switcher requirements
run-name: Check switcher requirements for ${{ inputs.repository }}
on:
workflow_dispatch:
inputs:
repository:
description: 'Repository (for example: python/python-docs-pl)'
required: true
type: string
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
repository: [ "${{ inputs.repository }}" ]
steps:
- name: Checkout current repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install blurb potodo
- name: Determine /3/ version and clone CPython
run: |
PYTHON_VERSION=$(curl -s https://docs.python.org/3/ | grep -oP 'Python \K\d+\.\d+' | head -1)
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
git clone --branch "$PYTHON_VERSION" --single-branch --depth 1 https://github.com/python/cpython.git
- name: Clone translation
run: |
git clone https://github.com/${{ matrix.repository }}.git translation-repo
cd translation-repo
git switch "$PYTHON_VERSION" || echo "No translation branch $PYTHON_VERSION"
- name: Generate POT files
run: |
cd cpython/Doc
make venv
make gettext
- name: Run potodo
run: |
cd translation-repo
potodo --pot ../cpython/Doc/build/gettext \
--exclude '**/*' '!tutorial/*' '!bugs.po' '!library/functions.po' \
| tee ../potodo-results.txt
- name: Verify requirements are met
run: |
if grep -q "% translated" potodo-results.txt; then
echo "Core resources are not fully translated"
exit 1
fi
- name: Upload potodo results
if: always()
uses: actions/upload-artifact@v4
with:
name: potodo-results
path: potodo-results.txt
retention-days: 30