-
Notifications
You must be signed in to change notification settings - Fork 28
162 lines (141 loc) · 4.64 KB
/
ci.yml
File metadata and controls
162 lines (141 loc) · 4.64 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
paths-ignore:
- 'README.md'
- 'demo/**'
jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup-python-env
with:
python-version: '3.11'
- name: Cache prek
uses: actions/cache@v4
with:
path: ~/.cache/prek
key: prek-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run checks
run: make check
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup-python-env
with:
python-version: '3.11'
- name: Build package
run: make build
- name: Verify build artifacts
run: |
ls -la dist/
# Verify both sdist and wheel are created
test -f dist/*.tar.gz || (echo "Source distribution not found" && exit 1)
test -f dist/*.whl || (echo "Wheel not found" && exit 1)
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
unit-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.14']
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup-python-env
with:
python-version: ${{ matrix.python-version }}
- name: Run unit tests
run: |
if [ "${{ env.RUNNER_DEBUG }}" = "true" ]; then
log_level=DEBUG
else
log_level=INFO
fi
set -o pipefail
uv run pytest tests/unit_tests/ -v --log-cli-level=${log_level} | tee pytest.log
tail -n 1 pytest.log | grep '=======' | grep 'passed' |grep -q 'failed' && exit 1 || exit 0
- name: Run integration tests without any test mode
run: |
if [ "${{ env.RUNNER_DEBUG }}" = "true" ]; then
log_level=DEBUG
else
log_level=INFO
fi
set -o pipefail
uv run pytest tests/integration_tests/ -v --log-cli-level=${log_level} -k "not server and not embedded and not oceanbase" | tee pytest.log
tail -n 1 pytest.log | grep '=======' | grep 'passed' |grep -q 'failed' && exit 1 || exit 0
integration-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false # Allow other jobs to continue if one fails
matrix:
test_mode: [embedded, server, oceanbase]
steps:
- name: Free disk space
uses: kfir4444/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Check out code
uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup-python-env
with:
python-version: '3.11'
- name: Start OceanBase container
if: matrix.test_mode == 'oceanbase'
uses: oceanbase/setup-oceanbase-ce@v1
with:
image_name: 'oceanbase/oceanbase-ce'
image_tag: '4.5.0.0-100000012025112711'
mode: 'mini'
sql_port: 10000
datafile_size: '20G'
log_disk_size: '10G'
tenant_name: 'mysql'
init_sql: "ALTER SYSTEM ob_vector_memory_limit_percentage = 30; create user 'jtuser'@'%'; GRANT SELECT, INSERT, UPDATE, DELETE ON test.* TO 'jtuser'@'%'; FLUSH PRIVILEGES;"
- name: Start seekdb server container
if: matrix.test_mode == 'server'
run: |
docker run --name seekdb-server -p 2881:2881 -d oceanbase/seekdb:1.0.0.0-100000262025111218
sleep 15
docker logs seekdb-server
- name: Run integration tests for ${{ matrix.test_mode }}
env:
CI: 1
SEEKDB_PATH: ${{ runner.temp }}/seekdb.db
OB_PORT: 10000
SERVER_PORT: 2881
run: |
# Run integration tests filtered by test mode
if [ "${{ env.RUNNER_DEBUG }}" = "true" ]; then
log_level=DEBUG
else
log_level=INFO
fi
set -o pipefail
uv run pytest tests/integration_tests/ -v --log-cli-level=${log_level} -k "${{ matrix.test_mode }}" | tee pytest.log
tail -n 1 pytest.log | grep '=======' | grep 'passed' | grep -q 'failed' && exit 1 || exit 0