Skip to content

Translations update from Hosted Weblate #13841

Translations update from Hosted Weblate

Translations update from Hosted Weblate #13841

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
test:
services:
postgres:
image: postgres:18.2-alpine@sha256:88f300be8635fe8a9ed4c18a68ba497fb6df1215fd2b074895afd027bd3e1006
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: weblate
POSTGRES_DB: weblate
mariadb:
image: mariadb:10.11.16@sha256:21d87f60a6d84d25871738c64e468ea56118d73e90f614fbde09695ca9879c6e
env:
MARIADB_ROOT_PASSWORD: weblate
MARIADB_DATABASE: weblate
ports:
- 3306:3306
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version:
- '3.11'
- '3.12'
- '3.13'
database:
- sqlite
- mariadb
- postgresql
name: Python ${{ matrix.python-version }}, ${{ matrix.database }}
env:
CI_DATABASE: ${{ matrix.database }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: true
fetch-depth: 0
- name: Install apt dependencies
# gettext is needed as Django uses msgfmt to compile MO files
run: |
sudo apt update
sudo apt install gettext
- name: Start validation service
env:
# renovate: datasource=github-releases depName=gflohr/e-invoice-eu-validator versioning=loose
VALIDATOR_VERSION: 2.16.4
run: |
curl -L "https://github.com/gflohr/e-invoice-eu-validator/releases/download/v$VALIDATOR_VERSION/validator-$VALIDATOR_VERSION-jar-with-dependencies.jar" > /tmp/validator.jar
PORT=7070 java -jar /tmp/validator.jar > /tmp/validator.log 2>&1 &
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
with:
cache-suffix: test
version: 0.10.2
- name: Install pip dependencies
run: uv pip install --system -r requirements-dev.txt
- name: Compile MO files
run: ./scripts/generate-locales
- name: Collect static files
run: ./manage.py collectstatic
- name: Django checks
run: ./manage.py check
- name: Test with Django
env:
EINVOICE_VALIDATOR_URL: http://localhost:7070/
run: |
pytest --junitxml=junit.xml weblate_web
cp .coverage .coverage.pytest
- name: Migrations
run: |
# First version with database backends tests
git checkout 7ba420b18ec3c7d32fb71823335e068f15b96855
./manage.py migrate
./manage.py shell -c 'customer = Customer.objects.create(user_id=-1); payment = Payment.objects.create(customer=customer, amount=1); Payment.objects.create(customer=customer, amount=1, repeat=payment)'
EXISTING_PK=$(./manage.py dumpdata payments.Payment | jq '.[].pk' | tr -d - | sort)
EXISTING_REPEAT=$(./manage.py dumpdata payments.Payment | jq '.[].fields.repeat' | tr -d - | sort)
git checkout "$GITHUB_SHA"
coverage run ./manage.py migrate
NEW_PK=$(./manage.py dumpdata payments.Payment | jq '.[].pk' | tr -d - | sort)
NEW_REPEAT=$(./manage.py dumpdata payments.Payment | jq '.[].fields.repeat' | tr -d - | sort)
if [ "$NEW_PK" != "$EXISTING_PK" ] ; then
echo "Migration failed (pk): $NEW_PK != $EXISTING_PK"
exit 1
fi
if [ "$NEW_REPEAT" != "$EXISTING_REPEAT" ] ; then
echo "Migration failed (repeat): $NEW_REPEAT != $EXISTING_REPEAT"
exit 1
fi
- name: Coverage
run: |
coverage combine
coverage xml
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{secrets.CODECOV_TOKEN}}
flags: unittests
name: Python ${{ matrix.python-version }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Show validation logs
if: ${{ !cancelled() }}
run: cat /tmp/validator.log
permissions:
contents: read