diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2722767..e9d57e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: branches: [main, "feature/**"] pull_request: branches: [main] + schedule: + - cron: "0 3 * * *" # Nightly at 03:00 UTC — runs docker-e2e + workflow_dispatch: jobs: test: @@ -22,8 +25,8 @@ jobs: - name: Install dependencies run: uv pip install --system ".[dev]" - - name: Run tests - run: pytest tests/ -v --tb=short + - name: Run tests (parallel) + run: pytest tests/ -v --tb=short -n auto env: TESTING: "1" @@ -34,3 +37,32 @@ jobs: - name: Build Docker image run: docker build -t data-analyst:test . + + docker-e2e: + runs-on: ubuntu-latest + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + needs: docker-build + steps: + - uses: actions/checkout@v5 + + - uses: actions/setup-python@v6 + with: + python-version: "3.13" + + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Install dependencies + run: uv pip install --system ".[dev]" + + - name: Start services + run: docker compose up -d --wait --wait-timeout 60 + + - name: Run Docker E2E tests + run: pytest tests/ -v --tb=short -m docker --timeout=120 + env: + TESTING: "1" + + - name: Stop services + if: always() + run: docker compose down