|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "**" |
| 7 | + pull_request: |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: tests-${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + unit: |
| 19 | + runs-on: ubuntu-24.04 |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + python-version: ["3.10", "3.12"] |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 25 | + - name: Check out the compatible pg_diag source |
| 26 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 27 | + with: |
| 28 | + repository: O2eg/pg_diag |
| 29 | + path: .ci-components/pg_diag |
| 30 | + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| 31 | + with: |
| 32 | + python-version: ${{ matrix.python-version }} |
| 33 | + - run: python -m pip install --editable .ci-components/pg_diag --editable '.[dev]' |
| 34 | + - run: ruff check --exclude .ci-components . |
| 35 | + - run: ruff format --check --exclude .ci-components . |
| 36 | + - run: python -m pytest -q |
| 37 | + |
| 38 | + distribution: |
| 39 | + runs-on: ubuntu-24.04 |
| 40 | + needs: unit |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 43 | + - name: Check out the compatible pg_diag source |
| 44 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 45 | + with: |
| 46 | + repository: O2eg/pg_diag |
| 47 | + path: .ci-components/pg_diag |
| 48 | + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| 49 | + with: |
| 50 | + python-version: "3.12" |
| 51 | + - run: python -m pip install 'build>=1.2,<2' 'twine>=6,<7' |
| 52 | + - run: python -m build |
| 53 | + - run: python -m twine check dist/* |
| 54 | + - name: Smoke-test built wheel |
| 55 | + shell: bash |
| 56 | + run: | |
| 57 | + python -m venv "${RUNNER_TEMP}/pg-perf-bench-wheel-smoke" |
| 58 | + "${RUNNER_TEMP}/pg-perf-bench-wheel-smoke/bin/python" -m pip install \ |
| 59 | + --editable .ci-components/pg_diag |
| 60 | + "${RUNNER_TEMP}/pg-perf-bench-wheel-smoke/bin/python" -m pip install dist/*.whl |
| 61 | + "${RUNNER_TEMP}/pg-perf-bench-wheel-smoke/bin/pg-perf-bench" --version |
| 62 | + "${RUNNER_TEMP}/pg-perf-bench-wheel-smoke/bin/pg-perf-bench" validate |
| 63 | + "${RUNNER_TEMP}/pg-perf-bench-wheel-smoke/bin/pg-perf-bench" \ |
| 64 | + --machine --component-capabilities |
| 65 | +
|
| 66 | + postgres-18: |
| 67 | + if: github.event_name == 'workflow_dispatch' |
| 68 | + runs-on: ubuntu-24.04 |
| 69 | + needs: unit |
| 70 | + timeout-minutes: 120 |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 73 | + - name: Check out the compatible pg_diag source |
| 74 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 75 | + with: |
| 76 | + repository: O2eg/pg_diag |
| 77 | + path: .ci-components/pg_diag |
| 78 | + - name: Check out the compatible pg_stand source |
| 79 | + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
| 80 | + with: |
| 81 | + repository: O2eg/pg_stand |
| 82 | + path: .ci-components/pg_stand |
| 83 | + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 |
| 84 | + with: |
| 85 | + python-version: "3.12" |
| 86 | + - run: | |
| 87 | + python -m pip install \ |
| 88 | + --editable .ci-components/pg_diag \ |
| 89 | + --editable .ci-components/pg_stand \ |
| 90 | + --editable '.[dev]' |
| 91 | + - name: Run PostgreSQL 18 pg_stand integration |
| 92 | + env: |
| 93 | + PG_PERF_BENCH_PG_STAND_INTEGRATION: "1" |
| 94 | + PG_STAND_BIN: pg-stand |
| 95 | + PYTHONDONTWRITEBYTECODE: "1" |
| 96 | + run: python -m pytest -q -m integration tests/integration/test_pg_stand_smoke.py |
0 commit comments