Skip to content

fix(coverage): Python 3.14 on windows needs this #405

fix(coverage): Python 3.14 on windows needs this

fix(coverage): Python 3.14 on windows needs this #405

Workflow file for this run

name: Compile .mo files
on:
workflow_dispatch:
push:
paths:
- ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.po
# prevent race conditions
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
compile-mo-files:
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
runs-on: ubuntu-latest
env:
MO_FILES_CHANGED: false
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Checkout MethodicConfigurator
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.x'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- name: Cache apt packages
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
/var/cache/apt/archives/*.deb
/var/lib/apt/lists/*
key: ${{ runner.os }}-apt-gettext-ubuntu2204
restore-keys: |
${{ runner.os }}-apt-gettext-
${{ runner.os }}-apt-
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y gettext=0.21-14ubuntu2
- name: Compile translation .mo files from the .po files
run: python .github/skills/update-gui-translations/scripts/create_mo_files.py
- name: Stage changes
run: |
git add ardupilot_methodic_configurator/locale/**/ardupilot_methodic_configurator.mo
if [ -n "$(git status --porcelain)" ]; then
echo "MO_FILES_CHANGED=true" >> $GITHUB_ENV
else
echo "No changes to commit"
fi
- name: Create Pull Request
if: env.MO_FILES_CHANGED == 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
labels: i18n, automated-pr
token: ${{ secrets.GITHUB_TOKEN }}
branch: compile-mo-translation-files
title: "Compile .mo translation files"
commit-message: "chore(translations): Compile translation .mo files from the .po files"
body: |
This PR Compiles .mo files based on the latest changes to .po translation files.
delete-branch: true