diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 2cbcb8e11..4e9b1556c 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -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) \ No newline at end of file diff --git a/.github/scripts/update.sh b/.github/scripts/update.sh index d2f6f13be..4a15d3095 100755 --- a/.github/scripts/update.sh +++ b/.github/scripts/update.sh @@ -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 diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 3d2741421..83a51080a 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -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: