diff --git a/.github/workflows/pgmq_python.yml b/.github/workflows/pgmq_python.yml new file mode 100644 index 0000000..681bf4d --- /dev/null +++ b/.github/workflows/pgmq_python.yml @@ -0,0 +1,76 @@ +name: tembo-pgmq-python CI workflow + +defaults: + run: + shell: bash + working-directory: tembo-pgmq-python + +on: + pull_request: + branches: + - main + paths: + - ".github/workflows/pgmq_python.yml" + - "tembo-pgmq-python/tembo_pgmq_python/**" + - "tembo-pgmq-python/tests/**" + - "tembo-pgmq-python/pyproject.toml" + - "pgmq-extension/**" + push: + branches: + - main + paths: + - ".github/workflows/pgmq_python.yml" + - "tembo-pgmq-python/tembo_pgmq_python/**" + - "tembo-pgmq-python/tests/**" + - "tembo-pgmq-python/pyproject.toml" + - "pgmq-extension/**" +jobs: + lints: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11.0 + uses: actions/setup-python@v2 + with: + python-version: 3.11.0 + - name: Install dependencies + run: | + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 - + poetry install + - name: Lints / Type Checking + run: make lints + + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11.0 + uses: actions/setup-python@v2 + with: + python-version: 3.11.0 + - name: Install dependencies + run: | + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 - + poetry install --extras "async" + - name: Unit and Integration Tests + run: make test + + publish: + runs-on: ubuntu-latest + # only publish off main branch + if: github.repository == 'tembo-io/pgmq' && github.ref == 'refs/heads/main' + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11.0 + uses: actions/setup-python@v2 + with: + python-version: 3.11.0 + - name: Install dependencies + run: | + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 - + poetry install + - name: Publish + env: + POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} + run: | + poetry publish --build --skip-existing