-
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (111 loc) · 3.02 KB
/
ci.yml
File metadata and controls
136 lines (111 loc) · 3.02 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
tests-linux:
name: Tests (Python ${{ matrix.python-version }} on Linux)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12']
services:
mysql:
image: mysql:8
env:
MYSQL_DATABASE: testizer_email_funnels_test
MYSQL_USER: testuser
MYSQL_PASSWORD: testpassword
MYSQL_ROOT_PASSWORD: rootpassword
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h 127.0.0.1 -u$$MYSQL_USER -p$$MYSQL_PASSWORD || exit 1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: testuser
DB_PASSWORD: testpassword
DB_NAME: testizer_email_funnels_test
DB_CHARSET: utf8mb4
TEST_DB_HOST: 127.0.0.1
TEST_DB_PORT: 3306
TEST_DB_NAME: testizer_email_funnels_test
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run black check
run: |
python -m black . --check
- name: Run ruff
run: |
python -m ruff check .
- name: Run mypy
run: |
python -m mypy .
- name: Run unit tests
run: |
python -m pytest -m "not integration"
- name: Run integration tests
run: |
python -m pytest -m "integration"
tests-windows:
name: Tests (Python ${{ matrix.python-version }} on Windows)
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.11', '3.12']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run black check
run: |
python -m black . --check
- name: Run ruff
run: |
python -m ruff check .
- name: Run mypy
run: |
python -m mypy .
- name: Run unit tests
run: |
python -m pytest -m "not integration"
docker:
name: Docker build and tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t testizer-funnel-engine .
- name: Run tests inside Docker image
run: |
docker run --rm testizer-funnel-engine python -m pytest