mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-04 07:24:22 +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:
parent
e847c13fb7
commit
efa593e020
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@ -78,13 +78,31 @@ jobs:
|
|||||||
- name: Compare no translation to no-op translation
|
- name: Compare no translation to no-op translation
|
||||||
run: diff -r expanded no-op
|
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:
|
translations:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- find-translations
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
language:
|
language: ${{ fromJSON(needs.find-translations.outputs.languages) }}
|
||||||
- da
|
|
||||||
- ko
|
|
||||||
env:
|
env:
|
||||||
MDBOOK_BOOK__LANGUAGE: ${{ matrix.language }}
|
MDBOOK_BOOK__LANGUAGE: ${{ matrix.language }}
|
||||||
MDBOOK_PREPROCESSOR__GETTEXT__PO_FILE: po/${{ matrix.language }}.po
|
MDBOOK_PREPROCESSOR__GETTEXT__PO_FILE: po/${{ matrix.language }}.po
|
||||||
|
Loading…
Reference in New Issue
Block a user