|
| 1 | +name: tembo-pgmq-python CI workflow |
| 2 | + |
| 3 | +defaults: |
| 4 | + run: |
| 5 | + shell: bash |
| 6 | + working-directory: tembo-pgmq-python |
| 7 | + |
| 8 | +on: |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + paths: |
| 13 | + - ".github/workflows/pgmq_python.yml" |
| 14 | + - "tembo-pgmq-python/tembo_pgmq_python/**" |
| 15 | + - "tembo-pgmq-python/tests/**" |
| 16 | + - "tembo-pgmq-python/pyproject.toml" |
| 17 | + - "pgmq-extension/**" |
| 18 | + push: |
| 19 | + branches: |
| 20 | + - main |
| 21 | + paths: |
| 22 | + - ".github/workflows/pgmq_python.yml" |
| 23 | + - "tembo-pgmq-python/tembo_pgmq_python/**" |
| 24 | + - "tembo-pgmq-python/tests/**" |
| 25 | + - "tembo-pgmq-python/pyproject.toml" |
| 26 | + - "pgmq-extension/**" |
| 27 | +jobs: |
| 28 | + lints: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + - name: Set up Python 3.11.0 |
| 33 | + uses: actions/setup-python@v2 |
| 34 | + with: |
| 35 | + python-version: 3.11.0 |
| 36 | + - name: Install dependencies |
| 37 | + run: | |
| 38 | + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 - |
| 39 | + poetry install |
| 40 | + - name: Lints / Type Checking |
| 41 | + run: make lints |
| 42 | + |
| 43 | + tests: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + - name: Set up Python 3.11.0 |
| 48 | + uses: actions/setup-python@v2 |
| 49 | + with: |
| 50 | + python-version: 3.11.0 |
| 51 | + - name: Install dependencies |
| 52 | + run: | |
| 53 | + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 - |
| 54 | + poetry install --extras "async" |
| 55 | + - name: Unit and Integration Tests |
| 56 | + run: make test |
| 57 | + |
| 58 | + publish: |
| 59 | + runs-on: ubuntu-latest |
| 60 | + # only publish off main branch |
| 61 | + if: github.repository == 'tembo-io/pgmq' && github.ref == 'refs/heads/main' |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v4 |
| 64 | + - name: Set up Python 3.11.0 |
| 65 | + uses: actions/setup-python@v2 |
| 66 | + with: |
| 67 | + python-version: 3.11.0 |
| 68 | + - name: Install dependencies |
| 69 | + run: | |
| 70 | + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 - |
| 71 | + poetry install |
| 72 | + - name: Publish |
| 73 | + env: |
| 74 | + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} |
| 75 | + run: | |
| 76 | + poetry publish --build --skip-existing |
0 commit comments