-
Notifications
You must be signed in to change notification settings - Fork 98
94 lines (77 loc) · 2.35 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
86
87
88
89
90
91
92
93
94
name: Build pghoard
# Default to read-only access to all APIs.
permissions: read-all
on:
push:
branches:
- main
tags:
- '**'
pull_request:
jobs:
lint:
runs-on: ubuntu-22.04
strategy:
matrix:
# only use one version for the lint step
python-version: ["3.10"]
steps:
- id: checkout-code
uses: actions/checkout@v3
with:
# Do not persist the token during execution of this job.
persist-credentials: false
- id: prepare-python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- id: dependencies
run: |
pip install .
pip install ".[dev]"
- id: pylint
run: make lint
- id: mypy
run: make mypy
- id: validate-style
run: |
make fmt
if [ $(git diff --name-only --diff-filter=ACMR | wc -l ) != 0 ]; then
echo "Reformatting failed! Please run make fmt on your commits and resubmit!" 1>&2;
git diff;
exit 1;
fi
test:
runs-on: ubuntu-22.04
needs: lint
strategy:
max-parallel: 5
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- id: checkout-code
uses: actions/checkout@v3
- id: prepare-python
uses: actions/setup-python@v3
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 postgresql-12 postgresql-13 postgresql-14 postgresql-15 postgresql-16 postgresql-17
# Setup common python dependencies
python -m pip install --upgrade pip
pip install .
pip install ".[constraints]"
pip install -e .
- id: unittest
run: make coverage
- id: upload-codecov
# Third-party action pinned to v3.1.1
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
verbose: true