Skip to content

optimize build time #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 4, 2023
2 changes: 1 addition & 1 deletion .github/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ cd cpython/Doc || exit 1
mkdir -p locales/"$LOCALE"/
ln -sfn "$(realpath ../../docs)" locales/"$LOCALE"/LC_MESSAGES
pip3 install -q -r requirements.txt
make html SPHINXOPTS="-D language=$LOCALE -D gettext_compact=0 -W --keep-going" 2> >(error)
sphinx-build -b dummy -d build/doctrees -j auto -D language=$LOCALE -D gettext_compact=0 -W --keep-going -W . build/html 2> >(error)
16 changes: 16 additions & 0 deletions .github/scripts/update.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash

cd cpython || exit 1

# Restore git timestamp for enabling build cache
rev=HEAD
for f in $(git ls-tree -r -t --full-name --name-only "$rev" Doc) ; do
touch -d $(git log --pretty=format:%cI -1 "$rev" -- "$f") "$f";
done

cd ..
cd docs || exit 1

# Restore git timestamp for enabling build cache
rev=HEAD
for f in $(git ls-tree -r -t --full-name --name-only "$rev") ; do
touch -d $(git log --pretty=format:%cI -1 "$rev" -- "$f") "$f";
done

$(realpath ../tx) pull --languages "$LOCALE" -t --use-git-timestamps --workers 25 --silent
9 changes: 9 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,17 @@ jobs:
run: .github/scripts/update.sh
env:
TX_TOKEN: ${{ secrets.TRANSIFEX_APIKEY }}
- uses: actions/cache/restore@v3
with:
path: cpython/Doc/build
key: cache-${{ inputs.version }}-${{ github.run_id }}
restore-keys: cache-${{ inputs.version }}-
- name: build
run: .github/scripts/build.sh
- uses: actions/cache/save@v3
with:
path: cpython/Doc/build
key: cache-${{ inputs.version }}-${{ github.run_id }}
- name: stat
run: python .github/scripts/tx_stat.py > ./docs/.stat.json
env:
Expand Down