From 85f00f0bba79535b6ac1658c00451a88745d55a3 Mon Sep 17 00:00:00 2001 From: dalance Date: Fri, 17 May 2024 12:34:29 +0900 Subject: [PATCH] Adjust translation build on CI --- .github/workflows/rbe.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rbe.yml b/.github/workflows/rbe.yml index 7169ba8261..27be803bc6 100644 --- a/.github/workflows/rbe.yml +++ b/.github/workflows/rbe.yml @@ -55,15 +55,7 @@ jobs: - name: Build all translations run: | for po_lang in ${{ env.LANGUAGES }}; do - POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/') - if [[ $POT_CREATION_DATE == "" ]]; then - POT_CREATION_DATE=now - fi - - echo "::group::Building $po_lang translation as of $POT_CREATION_DATE" - rm -r src/ - git restore --source "$(git rev-list -n 1 --before "$POT_CREATION_DATE" @)" src/ - + echo "::group::Building $po_lang translation" # Set language and adjust site URL. Clear the redirects # since they are in sync with the source files, not the # translation. @@ -74,6 +66,15 @@ jobs: echo "::endgroup::" done + - name: Check all translations for broken links + run: | + for po_lang in ${{ env.LANGUAGES }}; do + MDBOOK_BOOK__LANGUAGE=$po_lang \ + MDBOOK_OUTPUT__HTML__SITE_URL=/rust-by-example/$po_lang/ \ + MDBOOK_OUTPUT__HTML__REDIRECT='{}' \ + sh linkcheck.sh --all rust-by-example + done + - name: Upload Artifact uses: actions/upload-artifact@v3 with: