feat: type annotations and update to psycopg3 #36
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: Coverage | |
on: ["push", "pull_request"] | |
jobs: | |
build: | |
name: Coverage | |
runs-on: ubuntu-latest | |
container: ubuntu:latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: rawl | |
POSTGRES_PASSWORD: s3cretpass | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install system dependencies | |
run: | | |
apt update | |
apt upgrade -y | |
apt install -y build-essential libpq-dev git curl | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.dev.txt | |
if [ -f requirements.txt ]; then | |
pip install -r requirements.txt | |
else | |
pip install -e . | |
fi | |
- name: Run Coverage | |
run: coverage run --source rawl -m py.test | |
env: | |
PG_DSN: postgresql://rawl:s3cretpass@postgres:5432/postgres | |
RAWL_DSN: postgresql://rawl:s3cretpass@postgres:5432/rawl_test | |
- name: Run Coverage | |
run: | | |
pytest --cov=./ --cov-report=xml | |
env: | |
PG_DSN: postgresql://rawl:s3cretpass@postgres:5432/postgres | |
RAWL_DSN: postgresql://rawl:s3cretpass@postgres:5432/rawl_test | |
- name: Upload to codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
fail_ci_if_error: true | |
verbose: true |