fix: refactor database environment variables in CI workflow for consistency #9

Merged
zwitschi merged 3 commits from feat/ci-overhaul-20251029 into main 2025-11-02 11:21:15 +01:00
Showing only changes of commit 52450bc487 - Show all commits

View File

@@ -10,15 +10,21 @@ jobs:
test: test:
env: env:
APT_CACHER_NG: http://192.168.88.14:3142 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 runs-on: ubuntu-latest
services: services:
postgres: postgres:
image: postgres:17 image: postgres:17
env: env:
POSTGRES_USER: calminer POSTGRES_USER: ${ { env.DB_USER } }
POSTGRES_PASSWORD: calminer_password POSTGRES_PASSWORD: ${ { env.DB_PASSWORD } }
POSTGRES_DB: calminer_test POSTGRES_DB: ${ { env.DB_NAME } }
options: >- options: >-
--health-cmd pg_isready --health-cmd pg_isready
--health-interval 10s --health-interval 10s
@@ -34,34 +40,33 @@ jobs:
python-version: '3.11' python-version: '3.11'
- name: Update apt-cacher-ng config - 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 echo 'Acquire::http::Proxy "{{ env.APT_CACHER_NG }}";' | tee /etc/apt/apt.conf.d/01apt-cacher-ng
apt-get update apt-get update
- name: Update system packages - name: Update system packages
run: apt-get upgrade -y 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 - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
pip install -r requirements-test.txt pip install -r requirements-test.txt
- name: Install Playwright system dependencies
run: playwright install-deps
- name: Install Playwright browsers - name: Install Playwright browsers
run: playwright install run: playwright install
- name: Run tests - name: Run tests
env: env:
DATABASE_HOST: postgres DATABASE_DRIVER: postgresql+psycopg2
DATABASE_PORT: 5432 DATABASE_HOST: ${ { env.DB_HOST } }
DATABASE_USER: calminer DATABASE_PORT: ${ { env.DB_PORT } }
DATABASE_PASSWORD: calminer_password DATABASE_USER: ${ { env.DB_USER } }
DATABASE_NAME: calminer_test DATABASE_PASSWORD: ${ { env.DB_PASSWORD } }
DATABASE_DRIVER: postgresql DATABASE_NAME: ${ { env.DB_NAME } }
run: | run: |
pytest tests/ --cov=. pytest tests/ --cov=.