Skip to content

Lint translations using github actions #10

Lint translations using github actions

Lint translations using github actions #10

name: Quality Checks
on:
push:
branches:
- main
pull_request: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
translations:
name: Translations
runs-on: self-hosted
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Create virtualenv
run: virtualenv env
- name: Install pip dependencies
run: |
source env/bin/activate
pip install -e .[test]
- name: Extract messages
run: |
source env/bin/activate
python manage.py makemessages --locale=en --ignore=bluebottle/notifications/tests/ --settings=bluebottle.settings.testing
- name: Check missing translations
run: |
source env/bin/activate
python ./locale/check_translatoins.py --locales=nl > translation-message.txt
- name: Echo
run: echo translation-message.txt
- name: Post comment
uses: mshick/add-pr-comment@v2
if: always()
with:
message-path: translation-message.txt
refresh-message-position: true
lint:
name: Linting
runs-on: self-hosted
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: '3.8.17'
cache: pip
- name: Install pip dependencies
run: pip install -e .[test]
- name: Lint
run: flake8 .