5
5
branches :
6
6
- master
7
7
tags :
8
- - ' v*.*.*'
8
+ - " v*.*.*"
9
9
pull_request :
10
10
branches :
11
11
- master
@@ -15,58 +15,57 @@ jobs:
15
15
runs-on : ubuntu-latest
16
16
strategy :
17
17
matrix :
18
- python-version : [ ' 3.6', ' 3.7', ' 3.8' ]
19
- postgres-version : [ ' 9.6', ' 12.1' ]
18
+ python-version : [" 3.6", " 3.7", " 3.8", "3.9" ]
19
+ postgres-version : [" 9.6", " 12.1" ]
20
20
services :
21
21
postgres :
22
22
image : fantix/postgres-ssl:${{ matrix.postgres-version }}
23
23
env :
24
24
POSTGRES_USER : gino
25
25
ports :
26
- - 5432:5432
26
+ - 5432:5432
27
27
# needed because the postgres container does not provide a healthcheck
28
28
options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
29
29
steps :
30
- - name : Checkout source code
31
- uses : actions/checkout@v1
32
- - name : Set up Python
33
- uses : actions/setup-python@v1
34
- with :
35
- python-version : ${{ matrix.python-version }}
36
- - name : virtualenv cache
37
- uses : actions/cache@preview
38
- with :
39
- path : ~/.cache/pypoetry/virtualenvs
40
- key : ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles(format('{0}{1}', github.workspace, '/poetry.lock')) }}
41
- restore-keys : |
42
- ${{ runner.os }}-${{ matrix.python-version }}-poetry-
43
- - name : Install Python dependencies
44
- run : |
45
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
46
- $HOME/.poetry/bin/poetry install
47
- - name : Test with pytest
48
- env :
49
- DB_HOST : localhost
50
- DB_USER : gino
51
- run : |
52
- $HOME/.poetry/bin/poetry run pytest --cov=src --cov=examples --cov-fail-under=95 --cov-report xml
53
- - name : Check code format with black
54
- if : matrix.python-version >= '3.6'
55
- run : |
30
+ - name : Checkout source code
31
+ uses : actions/checkout@v1
32
+ - name : Set up Python
33
+ uses : actions/setup-python@v1
34
+ with :
35
+ python-version : ${{ matrix.python-version }}
36
+ - name : virtualenv cache
37
+ uses : actions/cache@preview
38
+ with :
39
+ path : ~/.cache/pypoetry/virtualenvs
40
+ key : ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles(format('{0}{1}', github.workspace, '/poetry.lock')) }}
41
+ restore-keys : |
42
+ ${{ runner.os }}-${{ matrix.python-version }}-poetry-
43
+ - name : Install Python dependencies
44
+ run : |
45
+ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
46
+ $HOME/.poetry/bin/poetry install
47
+ - name : Test with pytest
48
+ env :
49
+ DB_HOST : localhost
50
+ DB_USER : gino
51
+ run : |
52
+ $HOME/.poetry/bin/poetry run pytest --cov=src --cov=examples --cov-fail-under=95 --cov-report xml
53
+ - name : Check code format with black
54
+ run : |
56
55
$HOME/.poetry/bin/poetry run black --check src
57
- - name : Submit coverage report
58
- if : matrix.python-version == '3.8' && matrix.postgres-version == '12.1' && github.ref == 'refs/heads/master'
59
- env :
60
- CODACY_PROJECT_TOKEN : ${{ secrets.CODACY_TOKEN }}
61
- run : |
62
- pip install codacy-coverage
63
- python-codacy-coverage -r coverage.xml
56
+ - name : Submit coverage report
57
+ if : matrix.python-version == '3.8' && matrix.postgres-version == '12.1' && github.ref == 'refs/heads/master'
58
+ env :
59
+ CODACY_PROJECT_TOKEN : ${{ secrets.CODACY_TOKEN }}
60
+ run : |
61
+ pip install codacy-coverage
62
+ python-codacy-coverage -r coverage.xml
64
63
release :
65
64
runs-on : ubuntu-latest
66
65
needs : test
67
66
strategy :
68
67
matrix :
69
- python-version : [ ' 3.8' ]
68
+ python-version : [" 3.8" ]
70
69
steps :
71
70
- name : Checkout source code
72
71
if : startsWith(github.ref, 'refs/tags/')
0 commit comments