diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2a16e82..75c7598 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -10,15 +10,21 @@ jobs: test: env: APT_CACHER_NG: http://192.168.88.14:3142 + DB_DRIVER: postgresql + DB_HOST: postgres + DB_PORT: '5432' + DB_NAME: calminer_test + DB_USER: calminer + DB_PASSWORD: calminer_password runs-on: ubuntu-latest services: postgres: image: postgres:17 env: - POSTGRES_USER: calminer - POSTGRES_PASSWORD: calminer_password - POSTGRES_DB: calminer_test + POSTGRES_USER: ${ { env.DB_USER } } + POSTGRES_PASSWORD: ${ { env.DB_PASSWORD } } + POSTGRES_DB: ${ { env.DB_NAME } } options: >- --health-cmd pg_isready --health-interval 10s @@ -34,34 +40,33 @@ jobs: python-version: '3.11' - name: Update apt-cacher-ng config - run: | + run: |- echo 'Acquire::http::Proxy "{{ env.APT_CACHER_NG }}";' | tee /etc/apt/apt.conf.d/01apt-cacher-ng apt-get update - name: Update system packages run: apt-get upgrade -y - - name: Install system dependencies - run: | - apt-get install -y libxcursor1 libgtk-3-0t64 libnspr4 libnss3 libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 libxkbcommon0 libatspi2.0-0t64 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2t64 - - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt pip install -r requirements-test.txt + - name: Install Playwright system dependencies + run: playwright install-deps + - name: Install Playwright browsers run: playwright install - name: Run tests env: - DATABASE_HOST: postgres - DATABASE_PORT: 5432 - DATABASE_USER: calminer - DATABASE_PASSWORD: calminer_password - DATABASE_NAME: calminer_test - DATABASE_DRIVER: postgresql + DATABASE_DRIVER: postgresql+psycopg2 + DATABASE_HOST: ${ { env.DB_HOST } } + DATABASE_PORT: ${ { env.DB_PORT } } + DATABASE_USER: ${ { env.DB_USER } } + DATABASE_PASSWORD: ${ { env.DB_PASSWORD } } + DATABASE_NAME: ${ { env.DB_NAME } } run: | pytest tests/ --cov=. diff --git a/Dockerfile b/Dockerfile index 3f9aef7..0fae805 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG PYTHON_VERSION=3.11-slim ARG APT_CACHE_URL=http://192.168.88.14:3142 ARG UVICORN_WORKERS=4 -ARG UVICORN_PORT=8000 +ARG UVICORN_PORT=8003 FROM python:${PYTHON_VERSION} AS builder ARG APT_CACHE_URL diff --git a/docker-compose.yml b/docker-compose.yml index f92485c..9680f1e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dockerfile ports: - - "8000:8000" + - "8003:8003" environment: - DATABASE_HOST=postgres - DATABASE_PORT=5432