Ashwin/contrib #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: "Lint" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run ruff check | |
| run: uvx ruff@latest check --output-format=github . | |
| - name: Run ruff format | |
| run: uvx ruff@latest format --check . | |
| test-generic: | |
| name: "Tests · Generic" | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run generic tests | |
| run: | | |
| uv run pytest tests/ -v \ | |
| -m "not postgresql and not oracle and not mssql" \ | |
| --strict-markers --maxfail=100 \ | |
| --cov=taskiq_sqlalchemy \ | |
| --cov-report=xml:coverage-generic.xml | |
| # - name: Upload coverage | |
| # uses: codecov/codecov-action@v5 | |
| # with: | |
| # files: coverage-generic.xml | |
| # flags: generic | |
| # fail_ci_if_error: false | |
| test-postgresql: | |
| name: "Tests · PostgreSQL" | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| services: | |
| postgres: | |
| image: postgres:10 | |
| env: | |
| POSTGRES_USER: taskiq_user | |
| POSTGRES_PASSWORD: gOxN5hbl7geTwgvS | |
| POSTGRES_DB: taskiq | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U taskiq_user -d taskiq" | |
| --health-interval 5s | |
| --health-timeout 3s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run postgresql tests | |
| run: | | |
| uv run pytest tests/ -v \ | |
| -m "postgresql" \ | |
| --strict-markers --maxfail=100 \ | |
| --cov=taskiq_sqlalchemy \ | |
| --cov-report=xml:coverage-postgresql.xml | |
| # - name: Upload coverage | |
| # uses: codecov/codecov-action@v5 | |
| # with: | |
| # files: coverage-postgresql.xml | |
| # flags: postgresql | |
| # fail_ci_if_error: false | |
| test-oracle: | |
| name: "Tests · Oracle" | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Start Oracle service | |
| run: | | |
| cd docker | |
| docker compose up -d oracle | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Wait for Oracle to be healthy | |
| run: | | |
| cd docker | |
| echo "Waiting for Oracle service to become healthy..." | |
| for i in $(seq 1 60); do | |
| if [ "$(docker compose ps oracle --format json | jq -r '.Health')" = "healthy" ]; then | |
| echo "Oracle is healthy after ${i}s" | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "Oracle did not become healthy within 120 seconds" | |
| exit 1 | |
| - name: Run oracle tests | |
| run: | | |
| uv run pytest tests/ -v \ | |
| -m "oracle" \ | |
| --strict-markers --maxfail=100 \ | |
| --cov=taskiq_sqlalchemy \ | |
| --cov-report=xml:coverage-oracle.xml | |
| # - name: Upload coverage | |
| # uses: codecov/codecov-action@v5 | |
| # with: | |
| # files: coverage-oracle.xml | |
| # flags: oracle | |
| # fail_ci_if_error: false |