ci: add parallel test execution and nightly Docker E2E job
This commit is contained in:
parent
2ec50b4e4f
commit
5bfff6616c
1 changed files with 34 additions and 2 deletions
36
.github/workflows/ci.yml
vendored
36
.github/workflows/ci.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue