-
Notifications
You must be signed in to change notification settings - Fork 20
85 lines (68 loc) · 2.02 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
85
name: Build pglookout
on:
push:
branches:
- main
tags:
- '**'
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
# only use the newest version for the lint step -> as long as the other version can run it it's ok
python-version: [3.11]
steps:
- id: checkout-code
uses: actions/checkout@v2
- id: prepare-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- id: dependencies
run: |
pip install -e .
pip install -r requirements.dev.txt
- id: mypy
run: make mypy
- id: pylint
run: make pylint
- id: flake8
run: make flake8
- id: validate-style
run: make fmt-check
test:
runs-on: ubuntu-latest
needs: lint
strategy:
max-parallel: 4
matrix:
python-version: ['3.9', '3.10', '3.11']
pg-version: ['10', '11', '12', '13', '14', '15']
steps:
- id: checkout-code
uses: actions/checkout@v2
- id: prepare-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- id: dependencies
run: |
# Setup the Postgres repositories
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main 14" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
# Setup build deps
sudo apt-get install -y libsnappy-dev
sudo apt-get install -y postgresql-${{ matrix.pg-version }}
# Setup common python dependencies
python -m pip install --upgrade pip
pip install --upgrade pytest mock pytest-cov
pip install -e .
- id: unittest
run: make coverage
- id: upload-codecov
uses: codecov/codecov-action@v2
with:
verbose: true