-
Notifications
You must be signed in to change notification settings - Fork 10
96 lines (85 loc) · 2.43 KB
/
Copy pathintegration.yaml
File metadata and controls
96 lines (85 loc) · 2.43 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
---
name: Integration Tests
'on':
push:
branches: [main]
pull_request:
permissions:
contents: read
id-token: write
jobs:
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: test_password
MYSQL_DATABASE: lake
MYSQL_USER: devlake
MYSQL_PASSWORD: devlake_password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h localhost -u root -ptest_password"
--health-interval=10s
--health-timeout=5s
--health-retries=10
--tmpfs /var/lib/mysql:rw,noexec,nosuid,size=1024m
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Wait for MySQL to be ready
run: |
for i in {1..30}; do
if mysqladmin ping \
-h "127.0.0.1" -P 3306 -u devlake \
-pdevlake_password --silent; then
echo "MySQL is ready!"
break
fi
echo "Waiting for MySQL... ($i/30)"
sleep 2
done
- name: Initialize test database
run: |
mysql -h 127.0.0.1 -P 3306 -u root -ptest_password \
< testdata/mysql/01-schema.sql
mysql -h 127.0.0.1 -P 3306 -u root -ptest_password \
< testdata/mysql/02-test-data.sql
- name: Run integration tests
env:
TEST_DB_HOST: 127.0.0.1
TEST_DB_PORT: 3306
TEST_DB_USER: devlake
TEST_DB_PASSWORD: devlake_password
TEST_DB_NAME: lake
run: |
python -m pytest tests/integration/ \
-m integration \
-vv --tb=short \
--cov=. \
--cov-report=xml \
--cov-report=term \
--cov-branch
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
use_oidc: true
file: ./coverage.xml
flags: integration-tests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true