Skip to content

Merge pull request #4 from seandstewart/sean/initial-release #78

Merge pull request #4 from seandstewart/sean/initial-release

Merge pull request #4 from seandstewart/sean/initial-release #78

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11"]
poetry-version: ["1.4.2"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Maps tcp port 5432 on service container to the host
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_HOST_AUTH_METHOD: "trust"
POSTGRES_DB: test
POSTGRES_USER: postgres
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2.1.3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ./.venv
key: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project true
- name: Install Dependencies
run: pip install -U setuptools && poetry install --all-extras
- name: Test with pytest
run: |
poetry run pytest tests yesql --cov --cov-config=.coveragerc --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
env_vars: OS,PYTHON
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false