Update all non-major frontend-admin dependencies #5927
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 CI | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| run-tests: | |
| description: 'Run all backend tests' | |
| required: false | |
| default: true | |
| type: boolean | |
| generate-emails: | |
| description: 'Generate downloadable test e-mails' | |
| required: false | |
| default: false | |
| type: boolean | |
| pull_request: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'backend/**' | |
| - '.github/workflows/backend.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| generate-lockfile: | |
| name: Generate lockfile | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'pull_request'}} | |
| outputs: | |
| files_changed: ${{ steps.verify-changed-files.outputs.files_changed }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| - name: Install Poetry | |
| run: pipx install poetry | |
| - name: Set up Python 3.14 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| cache: 'poetry' | |
| cache-dependency-path: backend/poetry.lock | |
| - name: Generate lockfile | |
| working-directory: backend | |
| run: poetry lock | |
| - name: Verify lockfile has changed | |
| uses: tj-actions/verify-changed-files@v20 | |
| id: verify-changed-files | |
| with: | |
| files: | | |
| **/poetry.lock | |
| - name: Push lockfile changes | |
| if: steps.verify-changed-files.outputs.files_changed == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add backend/poetry.lock | |
| git commit -m "Update poetry.lock" | |
| git push | |
| run-tests: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.experimental }} | |
| needs: generate-lockfile | |
| if: ${{ always() && (needs.generate-lockfile.result == 'skipped' || | |
| (needs.generate-lockfile.result == 'success' && needs.generate-lockfile.outputs.files_changed == 'false'))}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python-version: '3.14' | |
| experimental: false | |
| defaults: | |
| run: | |
| working-directory: backend | |
| env: | |
| DJANGO_SETTINGS_MODULE: core.settings.ci | |
| services: | |
| postgres: | |
| image: postgres:18 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: github_actions | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| redis: | |
| image: redis:8 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install Poetry | |
| run: pipx install poetry | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'poetry' | |
| cache-dependency-path: backend/poetry.lock | |
| - name: Install dependencies | |
| run: poetry install --with ci | |
| - name: Check for model changes without migration | |
| run: poetry run python manage.py makemigrations --check | |
| - name: Synchronize database state and collect static files | |
| run: | | |
| poetry run python manage.py migrate --no-input | |
| poetry run python manage.py collectstatic --no-input --clear --link | |
| - name: Run tests | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.run-tests == 'true' }} | |
| run: poetry run pytest | |
| - name: Upload coverage to Codecov | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.run-tests == 'true' }} | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| directory: backend/ | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Archive code coverage results | |
| if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.run-tests == 'true' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: code-coverage-report | |
| path: backend/htmlcov/ | |
| - name: Generate e-mail artifacts | |
| if: ${{ github.event.inputs.generate-emails == 'true' }} | |
| env: | |
| BASE_URL_DOMAIN: felkeres.bsstudio.hu | |
| EMAIL_FILE: True | |
| run: poetry run python manage.py test tests.email_sending_tests | |
| - name: Archive sent e-mails | |
| if: ${{ github.event.inputs.generate-emails == 'true' }} | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: emails | |
| path: backend/logs/emails/ |