-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 1.46 KB
/
pull_request.yaml
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
name: pull request
on:
pull_request:
push:
branches: [ main ]
jobs:
python:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mainnet
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Initialize database
run: |
for file in ${{ github.workspace }}/database/*.sql; do
psql -h localhost -U postgres -d mainnet -f "$file"
done
env:
PGPASSWORD: postgres
- name: Setup Python 3.12
uses: actions/setup-python@v3
with:
python-version: '3.12'
- name: Install Requirements
run:
pip install -r requirements.txt
- name: Set PYTHONPATH
run: echo "PYTHONPATH=src" >> $GITHUB_ENV
- name: Pylint
run:
pylint --fail-under=8 $(git ls-files '**/*.py')
- name: Black
run:
black --check ./
- name: Type Check (mypy)
run: mypy src
- name: Tests
run: pytest tests/unit/ tests/e2e/
env:
NODE_URL: ${{ secrets.NODE_URL }}
SOLVER_SLIPPAGE_DB_URL: postgres:postgres@localhost:5432/mainnet
CHAIN_SLEEP_TIME: 1