Merge branch 'master' into feat/GPE-1115 #1120
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: CI Workflow | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:9.6 | |
env: | |
POSTGRES_USER: metadata_user | |
POSTGRES_PASSWORD: metadata_pass | |
POSTGRES_DB: test_metadata | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- uses: actions/cache@preview | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles(format('{0}{1}', github.workspace, '/poetry.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Install dependencies | |
run: | | |
pip install poetry | |
poetry install -vv --no-interaction | |
poetry show -vv | |
- name: Test with pytest | |
env: | |
DB_HOST: localhost | |
DB_PORT: 5432 | |
DB_USER: metadata_user | |
DB_PASSWORD: metadata_pass | |
PGPASSWORD: metadata_pass | |
run: | | |
poetry run pytest --cov=src --cov=migrations/versions --cov-fail-under=94 --cov-report xml | |
- name: Submit coverage report | |
if: github.ref == 'refs/heads/master' | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} | |
run: | | |
pip install coveralls | |
coveralls |