-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.24 KB
/
build.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
services:
postgres:
image: postgres:11.12
env:
POSTGRES_DB: dev
POSTGRES_USER: user
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
poetry-version: ["1.2.2"]
sqlalchemy-version: ["1.3.0", "1.4.0", "2.0.0b4"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Set up cache
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
run: poetry run make install
- name: Install specific sqlalchemy version
run: poetry run pip install 'sqlalchemy~=${{ matrix.sqlalchemy-version }}'
- name: Run linters
if: ${{ matrix.sqlalchemy-version == '1.4.0' }}
run: poetry run make lint
- name: Run tests
run: poetry run make test
- name: Store test result artifacts
uses: actions/upload-artifact@v3
with:
path: coverage.xml
- name: Coveralls
env:
COVERALLS_FLAG_NAME: run-${{ inputs.working-directory }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: |
pip install tomli coveralls
coveralls --service=github
finish:
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install tomli coveralls
coveralls --service=github --finish