-
Notifications
You must be signed in to change notification settings - Fork 12
69 lines (58 loc) · 1.77 KB
/
test-postgresql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: test-postgresql
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
services:
postgres:
image: postgres:latest
ports:
- 5433:5432
env:
POSTGRES_USER: pydapper
POSTGRES_PASSWORD: pydapper
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: checkout
uses: actions/checkout@v1
- name: set up python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install poetry
env:
POETRY_VERSION: "1.4.2"
run: |
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
- name: cache poetry.lock dependencies
id: cache-poetry-deps
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('poetry.lock') }}-postgresql
- name: install dependencies
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install -E psycopg2 -E aiopg
- name: test and coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GOOGLE_PRIVATE_KEY: ${{ secrets.GOOGLE_PRIVATE_KEY }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
poetry run pytest -m "postgresql" --cov=. --cov-branch -v --durations=25
poetry run coverage report -m
poetry run codecov -F ${{ matrix.python-version }}-postgresql