Prepare pg-workload for PyPI with synthetic profiles #1
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: tests | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: python -m pip install -e '.[dev]' | |
| - run: ruff check . | |
| - run: ruff format --check . | |
| - run: pytest -q | |
| package: | |
| runs-on: ubuntu-latest | |
| needs: unit | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.12" | |
| - run: python -m pip install build twine | |
| - run: python -m build | |
| - run: python -m twine check dist/* | |
| - name: Smoke-test installed wheel and bundled profiles | |
| shell: bash | |
| run: | | |
| python -m venv "${RUNNER_TEMP}/pg-workload-wheel-smoke" | |
| "${RUNNER_TEMP}/pg-workload-wheel-smoke/bin/python" -m pip install dist/*.whl | |
| "${RUNNER_TEMP}/pg-workload-wheel-smoke/bin/pg-workload" --version | |
| "${RUNNER_TEMP}/pg-workload-wheel-smoke/bin/pg-workload" init \ | |
| --directory "${RUNNER_TEMP}/pg-workload-project" | |
| "${RUNNER_TEMP}/pg-workload-wheel-smoke/bin/pg-workload" profiles \ | |
| --root "${RUNNER_TEMP}/pg-workload-project" | |
| "${RUNNER_TEMP}/pg-workload-wheel-smoke/bin/pg-workload" validate \ | |
| --root "${RUNNER_TEMP}/pg-workload-project" | |
| "${RUNNER_TEMP}/pg-workload-wheel-smoke/bin/python" -c \ | |
| 'import os; from pathlib import Path; root = Path(os.environ["RUNNER_TEMP"]) / "pg-workload-project/data"; assert len(list(root.glob("*/profile.yml"))) >= 7; assert not any(root.rglob("*.csv")); assert not any(root.rglob("*.tar.gz"))' | |
| postgres-18: | |
| runs-on: ubuntu-latest | |
| needs: unit | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.12" | |
| - run: python -m pip install -e '.[test]' | |
| - name: Run PostgreSQL 18 integration | |
| env: | |
| WORKLOAD_DOCKER_INTEGRATION: "1" | |
| PYTHONDONTWRITEBYTECODE: "1" | |
| run: pytest -q tests/test_docker_postgres18.py |