feat: Add dqlens diff — compare two profiles #9
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] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: dqlens | |
| POSTGRES_PASSWORD: dqlens | |
| POSTGRES_DB: dqlens_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U dqlens" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Run unit tests | |
| run: pytest tests/ -v --tb=short | |
| - name: Seed test database | |
| env: | |
| PGHOST: localhost | |
| PGUSER: dqlens | |
| PGPASSWORD: dqlens | |
| PGDATABASE: dqlens_test | |
| run: psql -f demo/seed_data_v2.sql | |
| - name: Run DQLens against live database | |
| env: | |
| DQLENS_TEST_DB: postgresql://dqlens:dqlens@localhost:5432/dqlens_test | |
| run: | | |
| dqlens init "$DQLENS_TEST_DB" --schema public | |
| dqlens profile | |
| dqlens run --ci --json-output > results.json || true | |
| cat results.json | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dqlens-results-py${{ matrix.python-version }} | |
| path: results.json | |
| retention-days: 7 | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Check import sorting | |
| run: pip install isort && isort --check-only --diff src/ tests/ | |
| - name: Type check | |
| run: pip install mypy types-PyYAML types-psycopg2 && mypy src/dqlens/ --ignore-missing-imports --no-error-summary || true |