-
Notifications
You must be signed in to change notification settings - Fork 4
80 lines (68 loc) · 1.73 KB
/
python_actions.yml
File metadata and controls
80 lines (68 loc) · 1.73 KB
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
name: Python CI actions
on:
push:
branches:
- main
pull_request:
env:
PGDATABASE: gateway
PGPASSWORD: password
PGUSER: user
PGHOST: localhost
PGPORT: 5432
SQLALCHEMY_DATABASE_URI: "postgresql://user:password@localhost:5432/gateway"
REDIS_SERVICE_URL: "redis://localhost:6379/0"
LIMITER_SERVICE_STORAGE_URI: "redis://localhost:6379/0"
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.4
env:
POSTGRES_DB: gateway
POSTGRES_PASSWORD: password
POSTGRES_USER: user
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
env:
REDIS_HOST: localhost
REDIS_PORT: 6379
ports:
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install setuptools==57.0.0 wheel psycopg2 pip==24.0
pip install .
pip install -e '.[dev]'
- name: Initialize postgres
run: |
alembic upgrade head
- name: Test with pytest
run: |
pytest
- name: Coveralls
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}