Update to Django 4.2.27 (#3856) #3047
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
| name: Backend | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - requirements/** | |
| - docker/config/server.env.template | |
| - pontoon/** | |
| - .github/workflows/backend.yml | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - requirements/** | |
| - docker/config/server.env.template | |
| - pontoon/** | |
| - .github/workflows/backend.yml | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: pytest | |
| env: | |
| UV_SYSTEM_PYTHON: 1 | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: pontoon | |
| POSTGRES_PASSWORD: pontoon | |
| POSTGRES_DB: pontoon | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U pontoon" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/requirements/*.txt | |
| # Version should match the one used in docker/Dockerfile | |
| version: "0.9.0" | |
| - name: Install requirements | |
| run: > | |
| uv pip install | |
| -r requirements/default.txt | |
| -r requirements/dev.txt | |
| -r requirements/test.txt | |
| -r requirements/lint.txt | |
| - name: Install pip-licenses | |
| run: uv pip install 'pip-licenses==5.0.0' | |
| - name: Check licenses | |
| run: | | |
| pip-licenses | |
| pip-licenses --fail-on="GNU General Public License (GPL)" --ignore-packages text-unidecode translate-toolkit | |
| # Set environment variables | |
| - run: uv pip install pytest-dotenv | |
| - run: > | |
| sed | |
| -e 's#^DATABASE_URL=.*#DATABASE_URL=postgres://pontoon:pontoon@localhost/pontoon#' | |
| -e '/^SITE_URL=/d' | |
| docker/config/server.env.template > .env | |
| # Run collectstatic with minimal dependencies, skipping the actual front-end build | |
| - run: npm install | |
| working-directory: pontoon | |
| - run: mkdir -p translate/dist translate/public | |
| - run: python manage.py collectstatic | |
| # Check if there are missing migrations | |
| - name: Verify missing migrations | |
| run: python manage.py makemigrations --check | |
| # Confirm that requirements have been correctly compiled. | |
| # Ignore comments and empty lines. | |
| - name: Check compiled requirements | |
| run: | | |
| bash docker/compile_requirements.sh | |
| for file in requirements/*.txt; do | |
| if ! diff <(grep -vE '^\s*#|^\s*$' "$file") <(git show HEAD:"$file" | grep -vE '^\s*#|^\s*$'); then | |
| echo "Error: $file is not up to date. Please run 'make requirements' and commit the changes." | |
| exit 1 | |
| fi | |
| done | |
| - name: Run tests | |
| run: pytest --cov-report=xml:pontoon/coverage.xml --cov=. | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| flags: backend | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |