-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (70 loc) · 1.99 KB
/
test.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
name: Linux
# Run on PR requests. And on master itself.
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Test, Linux, Python ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# 2022
- python: "3.10"
pins: ""
# 2023
- python: "3.11"
pins: ""
# current
- python: "3.12"
pins: ""
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
s3:
image: minio/minio:edge-cicd
env:
MINIO_DOMAIN: localhost # virtual hosted-style access
MINIO_ROOT_USER: cleanpython
MINIO_ROOT_PASSWORD: cleanpython
ports:
- 9000:9000
rabbitmq:
image: "rabbitmq:3-alpine"
env:
RABBITMQ_DEFAULT_USER: "cleanpython"
RABBITMQ_DEFAULT_PASS: "cleanpython"
RABBITMQ_DEFAULT_VHOST: "cleanpython"
ports:
- "5672:5672"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install python dependencies
run: |
pip install --disable-pip-version-check --upgrade pip setuptools
pip install -e .[fastapi,auth,celery,fluentbit,sql,sql-sync,s3,s3-sync,api-client,amqp,nanoid,test] ${{ matrix.pins }} psycopg2-binary==2.9.*
pip list
- name: Run tests
run: pytest tests --cov
- name: Wait for postgres
run: scripts/wait-for-postgres.sh
env:
POSTGRES_URL: 'postgres:postgres@localhost:5432'
timeout-minutes: 1
- name: Run integration tests
run: pytest integration_tests
env:
POSTGRES_URL: 'postgres:postgres@localhost:5432'
S3_URL: 'http://localhost:9000'