Merge pull request #230 from uktrade/dependabot/npm_and_yarn/multi-1c… #664
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: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: | |
- "3.7.1" | |
- "3.8.0" | |
- "3.9.0" | |
- "3.10.0" | |
- "3.11.0" | |
postgresql-version: | |
- "postgres:9.6" | |
- "postgres:10.0" | |
- "postgres:11.0" | |
- "postgres:12.0" | |
- "postgres:13.0" | |
- "postgres:14.0" | |
- "postgres:15.0" | |
- "postgres:16beta2" | |
# sqlalchemy 1.4 doesn't support psycopg3 | |
ci-extras: | |
- ci-psycopg2-sqlalchemy1 | |
- ci-psycopg2-sqlalchemy2 | |
- ci-psycopg3-sqlalchemy2 | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- uses: "actions/setup-python@v4" | |
with: | |
python-version: '${{ matrix.python-version }}' | |
- name: "Run PostgreSQL" | |
run: | | |
./start-services.sh ${{ matrix.postgresql-version }} | |
- name: "Install package and python dependencies" | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[ci,${{ matrix.ci-extras }}] | |
- name: "Wait for PostgreSQL" | |
run: "timeout 60 bash -c 'until echo > /dev/tcp/127.0.0.1/5432; do sleep 5; done'" | |
- name: "Run Type Checking" | |
run: | | |
mypy pg_bulk_ingest | |
- name: "Test" | |
run: | | |
pytest --cov | |
- uses: codecov/codecov-action@v3 |