feat(machinery): add Mistral integration #49496
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright © Michal Čihař <michal@weblate.org> | |
| # | |
| # SPDX-License-Identifier: GPL-3.0-or-later | |
| name: Test | |
| on: | |
| push: | |
| branches-ignore: | |
| - renovate/** | |
| - weblate | |
| - dependabot/** | |
| - copilot/** | |
| - codex/** | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| continue-on-error: ${{ matrix.experimental }} | |
| strategy: | |
| matrix: | |
| python-version: | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| requirements: | |
| - latest | |
| experimental: | |
| - false | |
| include: | |
| # Reduced testing for edge deps | |
| - python-version: '3.14' | |
| requirements: edge | |
| experimental: true | |
| name: py${{ matrix.python-version }}, ${{ matrix.requirements }} deps | |
| env: | |
| CI_REDIS_HOST: 127.0.0.1 | |
| CI_REDIS_PORT: '6379' | |
| CI_DB_PASSWORD: weblate | |
| CI_DB_HOST: 127.0.0.1 | |
| CI_DB_PORT: '5432' | |
| CI_SELENIUM: '1' | |
| DJANGO_SETTINGS_MODULE: weblate.settings_test | |
| PYTHONWARNINGS: default,ignore:unclosed:ResourceWarning | |
| PYTHONUNBUFFERED: 1 | |
| services: | |
| database: | |
| image: postgres:18.4-alpine@sha256:96d56f7f57c6aacd1fcb908bc83b345ec5f83231ee486dd66a1baadce274db88 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: weblate | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| cache: | |
| image: valkey/valkey:9.1.0-alpine@sha256:a35428eba9043cc0b79dbe54100f0c92784f2de00ad09b01182bfb1c5c83d1bd | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: data-test/cache/tesseract | |
| key: tesseract-data | |
| - name: Set up Python ${{ matrix.python-version }} | |
| id: setup_python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 26 | |
| package-manager-cache: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| save-cache: ${{ github.ref == 'refs/heads/main' }} | |
| cache-suffix: ${{ steps.setup_python.outputs.python-version }} | |
| version: 0.11.19 | |
| - name: Install apt dependencies | |
| run: sudo ./ci/apt-install | |
| - name: Install Python dependencies | |
| run: ./ci/pip-install ${{ matrix.requirements }} | |
| - name: Used versions | |
| run: | | |
| source .venv/bin/activate | |
| ./ci/print-versions | |
| - name: Prepare database | |
| run: ./ci/prepare-database | |
| - name: Compile MO files | |
| run: uv run coverage run ./manage.py compilemessages | |
| - name: Collect static files | |
| run: uv run coverage run ./manage.py collectstatic --noinput --verbosity 0 | |
| - name: Migrate database | |
| run: uv run coverage run ./manage.py migrate --noinput --traceback | |
| - name: Django checks | |
| run: uv run coverage run ./manage.py check | |
| - name: Demo import | |
| run: | | |
| uv run coverage run ./manage.py import_demo | |
| # Second execution with --delete should remove and recreate | |
| uv run coverage run ./manage.py import_demo --delete | |
| uv run coverage run ./manage.py billing_demo | |
| # Second execution should gracefully handle existing project | |
| uv run coverage run ./manage.py billing_demo | |
| - name: Keep coverage | |
| run: | | |
| mkdir -p build/coverage | |
| mv .coverage.* build/coverage | |
| - name: Test with Django | |
| run: | | |
| source .venv/bin/activate | |
| uv run --all-extras pytest --junitxml=junit.xml --cov=weblate --numprocesses=auto weblate | |
| cp .coverage .coverage.pytest | |
| - name: Test wsgi startup | |
| env: | |
| PYTHONPATH: . | |
| run: uv run coverage run weblate/wsgi.py | |
| - name: Coverage | |
| run: | | |
| mv build/coverage/.coverage.* . | |
| uv run coverage combine | |
| uv run coverage xml | |
| - name: Install client dependencies for Argos CI | |
| if: matrix.python-version == '3.14' && matrix.requirements == 'latest' && github.repository_owner == 'WeblateOrg' | |
| working-directory: ./client | |
| run: yarn install --immutable | |
| - name: Argos CI upload | |
| if: matrix.python-version == '3.14' && matrix.requirements == 'latest' && github.repository_owner == 'WeblateOrg' | |
| working-directory: ./client | |
| env: | |
| ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }} # zizmor: ignore[secrets-outside-env] | |
| run: yarn argos upload ../test-images/ | |
| - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| token: ${{secrets.CODECOV_TOKEN}} # zizmor: ignore[secrets-outside-env] | |
| flags: unittests | |
| name: Tests py${{ matrix.python-version }}, ${{ matrix.requirements }} deps | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # zizmor: ignore[secrets-outside-env] | |
| report_type: test_results |