-
Notifications
You must be signed in to change notification settings - Fork 12
112 lines (105 loc) · 3.18 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Test suite
on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10","3.11" ]
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: test_db
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: username
MYSQL_PASSWORD: password
MYSQL_DATABASE: test_db
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10
minio:
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- 9000:9000
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: pip install hatch
- name: Lint
run: hatch run test:lint
- name: Test Local Storage provider & sqlite
env:
ENGINE: 'sqlite:///test.db?check_same_thread=False'
STORAGE_PROVIDER: 'LOCAL'
LOCAL_PATH: '/tmp/storage'
run: hatch run test:run
- name: Test Local Storage provider & postgresql
env:
ENGINE: 'postgresql+psycopg2://username:password@localhost:5432/test_db'
STORAGE_PROVIDER: 'LOCAL'
LOCAL_PATH: '/tmp/storage'
run: hatch run test:run
- name: Test Local Storage provider & mysql
env:
ENGINE: 'mysql+pymysql://username:password@localhost:3306/test_db'
STORAGE_PROVIDER: 'LOCAL'
LOCAL_PATH: '/tmp/storage'
run: hatch run test:run
- name: Test Minio Storage provider & sqlite memory
env:
ENGINE: 'sqlite:///:memory:?check_same_thread=False'
STORAGE_PROVIDER: 'MINIO'
MINIO_KEY: 'minioadmin'
MINIO_SECRET: 'minioadmin'
MINIO_HOST: 'localhost'
MINIO_PORT: 9000
MINIO_SECURE: false
run: hatch run test:run
- name: store coverage files
uses: actions/upload-artifact@v3
with:
name: coverage
path: .coverage*
retention-days: 1
coverage:
needs:
- tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: get coverage files
uses: actions/download-artifact@v3
with:
name: coverage
- name: Install Dependencies
run: pip install hatch
- name: Coverage Report
run: hatch run cov:report
- name: Upload coverage
uses: codecov/codecov-action@v3