Skip to content

[AAP-69237] Realigning service with Platform Framework #974

[AAP-69237] Realigning service with Platform Framework

[AAP-69237] Realigning service with Platform Framework #974

Workflow file for this run

name: "PR checks"
on:
pull_request:
jobs:
pr-checks:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: metrics_service
POSTGRES_USER: metrics_service
POSTGRES_PASSWORD: metrics_service
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: "Checkout metrics-service (${{ github.ref }})"
uses: actions/checkout@v6
- name: "Install uv"
uses: astral-sh/setup-uv@v7
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: "Check for changes in uv.lock"
run: |
uv sync
if ! git diff --quiet uv.lock; then
echo "uv.lock has changed. Run 'uv sync' locally and commit the updated lock file."
git diff uv.lock
exit 1 # Fail the job
fi
- name: "Run ruff check"
run: |
uvx ruff check --output-format=github .
- name: "Check ruff format"
run: |
uvx ruff format --check
- name: "Check for missing migrations"
env:
METRICS_SERVICE_DATABASES__default__HOST: localhost
METRICS_SERVICE_DATABASES__default__PORT: 5432
METRICS_SERVICE_DATABASES__default__USER: metrics_service
METRICS_SERVICE_DATABASES__default__PASSWORD: metrics_service
METRICS_SERVICE_DATABASES__default__NAME: metrics_service
METRICS_SERVICE_DATABASES__default__OPTIONS__sslmode: disable
run: |
if ! uv run ./manage.py makemigrations --check; then
echo "Models have changed. Run 'uv run ./manage.py makemigrations' locally and commit the updated migrations."
exit 1 # Fail the job
fi