name: CI on: push: branches: [main, develop] pull_request: branches: [main, develop] jobs: test: env: APT_CACHER_NG: http://192.168.88.14:3142 runs-on: ubuntu-latest services: postgres: image: postgres:17 env: POSTGRES_USER: calminer POSTGRES_PASSWORD: calminer_password POSTGRES_DB: calminer_test options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.11' - name: Update apt-cacher-ng config 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 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 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 run: | pytest tests/ --cov=. - name: Build Docker image run: | docker build -t calminer .