4 Commits

Author SHA1 Message Date
e254d50c0c Merge pull request 'fix: refactor database environment variables in CI workflow for consistency' (#9) from feat/ci-overhaul-20251029 into main
Some checks failed
CI / test (push) Failing after 1m55s
Reviewed-on: #9
2025-11-02 11:21:15 +01:00
6eef8424b7 fix: update DB_PORT to be a string in CI workflow for consistency
Some checks failed
CI / test (pull_request) Failing after 2m15s
2025-11-02 11:13:45 +01:00
c1f4902cf4 fix: update UVICORN_PORT to 8003 in Dockerfile and docker-compose.yml
Some checks failed
CI / test (pull_request) Failing after 3m19s
2025-11-02 11:07:28 +01:00
52450bc487 fix: refactor database environment variables in CI workflow for consistency
Some checks failed
CI / test (pull_request) Failing after 6m30s
2025-10-29 15:34:06 +01:00
3 changed files with 21 additions and 16 deletions

View File

@@ -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=.

View File

@@ -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

View File

@@ -6,7 +6,7 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
- "8003:8003"
environment:
- DATABASE_HOST=postgres
- DATABASE_PORT=5432