Compare commits
1 Commits
backup/fea
...
c0957c5f5c
| Author | SHA1 | Date | |
|---|---|---|---|
| c0957c5f5c |
@@ -35,17 +35,41 @@ jobs:
|
||||
- name: Run Ruff linting
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
ruff check src
|
||||
ruff check .
|
||||
|
||||
- name: Run Ruff formatting check
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
ruff format src --check
|
||||
ruff format . --check
|
||||
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:15.10
|
||||
env:
|
||||
POSTGRES_DB: test_db
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -67,6 +91,20 @@ jobs:
|
||||
source .venv/bin/activate
|
||||
uv sync --dev
|
||||
|
||||
- name: Wait for services to be ready
|
||||
run: |
|
||||
# Wait for PostgreSQL
|
||||
until pg_isready -h localhost -p 5432 -U postgres; do
|
||||
echo "Waiting for PostgreSQL..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Wait for Redis
|
||||
until redis-cli -h localhost -p 6379 ping; do
|
||||
echo "Waiting for Redis..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
- name: Run Django tests
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
@@ -74,6 +112,9 @@ jobs:
|
||||
python manage.py test --verbosity=2
|
||||
env:
|
||||
DJANGO_SETTINGS_MODULE: config.settings.test
|
||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_db
|
||||
REDIS_URL: redis://localhost:6379/0
|
||||
CELERY_BROKER_URL: redis://localhost:6379/0
|
||||
SECRET_KEY: test-secret-key-for-ci
|
||||
|
||||
build:
|
||||
@@ -81,7 +122,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
needs: [lint, test]
|
||||
if: github.event_name != 'pull_request'
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
||||
Reference in New Issue
Block a user