This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
Support bulk data loading from client #920
Workflow file for this run
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
name: Test Postgres | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- "*.md" | |
env: | |
PGPASSWORD: postgres | |
TESTDB: greenplum_python_test | |
PGUSER: postgres | |
jobs: | |
build: | |
name: Test Python${{ matrix.python-version }}, PSQL${{matrix.postgres-version}} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10"] | |
postgres-version: ['12', '13'] | |
include: | |
- tox_test: "test_py39" | |
python-version: "3.9" | |
- tox_test: "test_py310" | |
python-version: "3.10" | |
- dill_version: python3.9 | |
postgres-version: '12' | |
- dill_version: python3.9 | |
postgres-version: '13' | |
services: | |
postgres: | |
# we need postgres with plpython extension postgres base docker hub image did not have that | |
# I use this one | |
# image: yihong0618/postgres-plpython:${{ matrix.postgres-version }} | |
image: thorinschiffer/postgres-plpython:${{ matrix.postgres-version }} | |
env: | |
POSTGRES_USER: ${{ env.PGUSER }} | |
POSTGRES_PASSWORD: ${{ env.PGPASSWORD }} | |
POSTGRES_DB: ${{ env.TESTDB }} | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
- name: Create plpython3u language and environment | |
run: | | |
psql postgres://${{ env.PGUSER }}:${{ env.PGPASSWORD }}@localhost/${{ env.TESTDB }} -c "CREATE LANGUAGE plpython3u;" | |
- name: Install Dependencies | |
run: | | |
pip install tox==3.25.0 | |
- name: Run Tests | |
run: | | |
export POSTGRES_PASSWORD=${{ env.PGPASSWORD }} | |
export POSTGRES_USER=${{ env.PGUSER }} | |
export POSTGRES_DB=${{ env.TESTDB }} | |
tox -e ${{ matrix.tox_test }} | |
- name: Install Dependencies for greenplumpython dill | |
# plpytyhon for postgres install to pg services | |
run: | | |
pip install pip install --target=. dill | |
docker cp dill $(docker ps -q):/usr/lib/${{ matrix.dill_version }}/ | |
rm -rf dill pip | |
- name: Run Tests with dill | |
run: | | |
export POSTGRES_PASSWORD=${{ env.PGPASSWORD }} | |
export POSTGRES_USER=${{ env.PGUSER }} | |
export POSTGRES_DB=${{ env.TESTDB }} | |
tox -e ${{ matrix.tox_test }} |