1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-01 22:19:21 +02:00

Automatically build and test all translations (#298)

This changes the build workflow to first list all available `.po`
files, and then use this information to start parallel jobs which test
each translation.
This commit is contained in:
Martin Geisler 2023-01-30 13:41:19 +01:00 committed by GitHub
parent e847c13fb7
commit efa593e020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,13 +78,31 @@ jobs:
- name: Compare no translation to no-op translation
run: diff -r expanded no-op
find-translations:
runs-on: ubuntu-latest
outputs:
languages: ${{ steps.find-translations.outputs.languages }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Find translations
id: find-translations
shell: python
run: |
import os, json, pathlib
languages = [p.stem for p in pathlib.Path("po").iterdir() if p.suffix == ".po"]
github_output = open(os.environ["GITHUB_OUTPUT"], "a")
github_output.write("languages=")
json.dump(sorted(languages), github_output)
translations:
runs-on: ubuntu-latest
needs:
- find-translations
strategy:
matrix:
language:
- da
- ko
language: ${{ fromJSON(needs.find-translations.outputs.languages) }}
env:
MDBOOK_BOOK__LANGUAGE: ${{ matrix.language }}
MDBOOK_PREPROCESSOR__GETTEXT__PO_FILE: po/${{ matrix.language }}.po