-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
406 additions
and
344 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pip==24.3.1 | ||
poetry==1.8.4 | ||
tox==4.23.2 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,4 @@ jobs: | |
overwrite: true | ||
file_glob: true | ||
- name: Deploy to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
attestations: true | ||
uses: pypa/[email protected] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
name: Test tap-postgres | ||
|
||
env: | ||
FORCE_COLOR: 1 | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
@@ -37,18 +40,32 @@ concurrency: | |
|
||
jobs: | ||
tests: | ||
name: Python ${{ matrix.python-version }} / Postgres ${{ matrix.postgres-version }} | ||
runs-on: ubuntu-latest | ||
env: | ||
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.13" | ||
- "3.12" | ||
- "3.11" | ||
- "3.10" | ||
- "3.9" | ||
- "3.8" | ||
postgres-version: | ||
- "17" | ||
include: | ||
- python-version: "3.13" | ||
postgres-version: "12" | ||
- python-version: "3.13" | ||
postgres-version: "13" | ||
- python-version: "3.13" | ||
postgres-version: "14" | ||
- python-version: "3.13" | ||
postgres-version: "15" | ||
- python-version: "3.13" | ||
postgres-version: "16" | ||
|
||
steps: | ||
- name: Checkout code | ||
|
@@ -62,13 +79,19 @@ jobs: | |
chmod 600 ssl/pkey.key | ||
- name: Build Postgres container | ||
env: | ||
POSTGRES_VERSION: ${{ matrix.postgres-version }} | ||
run: | | ||
docker build . --tag meltano/log_based | ||
docker build . --build-arg POSTGRES_VERSION=${POSTGRES_VERSION} --tag meltano/log_based | ||
- name: Compose Postgres container | ||
env: | ||
POSTGRES_VERSION: ${{ matrix.postgres-version }} | ||
run: | | ||
docker compose -f docker-compose.yml up -d --wait --wait-timeout=30 | ||
- uses: isbang/[email protected] | ||
env: | ||
POSTGRES_VERSION: ${{ matrix.postgres-version }} | ||
|
||
# Leaving comments as this makes testing the openssh docker image easier and should save someone some time later | ||
# - name: Test SSH File Permissiosn | ||
|
@@ -78,27 +101,21 @@ jobs: | |
# docker exec openssh-server ps aux | ||
|
||
|
||
- run: docker ps | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
|
||
- name: Upgrade pip | ||
run: | | ||
pip install pip | ||
pip --version | ||
- name: Install Poetry | ||
run: | | ||
pip install poetry | ||
poetry --version | ||
- name: Install dependencies | ||
- name: Install Tox | ||
run: | | ||
poetry env use python${{ matrix.python-version }} | ||
poetry install | ||
python -m pip install --upgrade pip | ||
pipx install tox | ||
- name: Run pytest | ||
run: | | ||
poetry run pytest | ||
tox -e $(echo py${{ matrix.python-version }} | tr -d .) | ||
- name: Run lint | ||
run: | | ||
poetry run tox -e lint | ||
tox -e lint |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
FROM postgres:16 | ||
ARG POSTGRES_VERSION=17 | ||
FROM postgres:${POSTGRES_VERSION} | ||
|
||
RUN apt-get update | ||
RUN apt-mark hold locales | ||
RUN apt-get install curl ca-certificates -y | ||
RUN install -d /usr/share/postgresql-common/pgdg | ||
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc | ||
RUN sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
RUN apt-get update | ||
RUN apt-get install postgresql-server-dev-16 -y | ||
RUN sh -c 'export PATH=/usr/lib/postgresql/16/bin:$PATH' | ||
RUN apt-get install postgresql-16-wal2json -y | ||
ARG POSTGRES_VERSION=17 | ||
|
||
# Install prerequisites and configure PostgreSQL for wal2json | ||
RUN apt-get update && apt-mark hold locales && \ | ||
apt-get install -y curl ca-certificates && \ | ||
install -d /usr/share/postgresql-common/pgdg && \ | ||
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc && \ | ||
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | ||
|
||
RUN echo "Setting up PostgreSQL ${POSTGRES_VERSION} with wal2json" && \ | ||
apt-get update && \ | ||
apt-get install -y postgresql-server-dev-${POSTGRES_VERSION} && \ | ||
export PATH=/usr/lib/postgresql/${POSTGRES_VERSION}/bin:$PATH && \ | ||
apt-get install -y postgresql-${POSTGRES_VERSION}-wal2json |
This file contains 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
This file contains 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
Oops, something went wrong.