Skip to content
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

[ci] Ensure i18n up to date #397

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/workflows/build-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,12 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: pip

- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: python3 -m pip install nox
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/i18n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check Internationalization
# Ensure that the .po files are up to date with any changes to the guide text

on:
pull_request:
push:
branches:
- main

jobs:
update-i18n:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip

- name: Install Nox
run: python3 -m pip install nox

- name: Update .po files
run: nox -s update-translations

- name: Test for uncommitted changes
run: |
if [ -z "$(git status --porcelain)" ];
then
echo "No changes detected, translations are up to date!" >> $GITHUB_STEP_SUMMARY
exit 0
else
echo "Changes to .po files detected, please run `nox -s update-translations` to reflect changes to source text" >> $GITHUB_STEP_SUMMARY
echo "$(git status)"
echo "$(git diff)"
exit 1
fi
Loading