-
Notifications
You must be signed in to change notification settings - Fork 26
214 lines (204 loc) · 6.64 KB
/
cron.integration.yml
File metadata and controls
214 lines (204 loc) · 6.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: Daily Integration Tests
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
pull_request:
branches:
- main
paths:
- '.github/workflows/cron.integration.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Check New Version
id: version
env:
GH_TOKEN: ${{ github.token }}
run: |
version=$(gh api repos/databendlabs/databend/releases --jq '.[0].tag_name')
echo "version=$version" >> $GITHUB_OUTPUT
echo "Running integration tests with Databend version: **$version**" >> $GITHUB_STEP_SUMMARY
integration:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
cache-key: integration
- name: Run Core Integration Tests
run: make -C tests test-core DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }}
- name: Run Driver Integration Tests
run: make -C tests test-driver DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }}
- name: Run BendSQL Integration Tests
run: make -C tests test-bendsql DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }}
build-python:
name: build-python-${{ matrix.wheel }}
runs-on: ubuntu-latest
strategy:
matrix:
wheel: [py39-abi, cp38]
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
cache-key: bindings-python-linux-x64
target: x86_64-unknown-linux-gnu
- name: Get opts
id: opts
shell: bash
run: |
base_args="--release --strip --out dist"
if [[ "${{ matrix.wheel }}" == "py39-abi" ]]; then
wheel_args="--features py39-abi"
else
wheel_args="--no-default-features --features cp38 --interpreter python3.8"
fi
echo "BUILD_ARGS=${base_args} ${wheel_args}" >> $GITHUB_OUTPUT
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: bindings/python
target: x86_64-unknown-linux-gnu
manylinux: auto
sccache: "true"
args: ${{ steps.opts.outputs.BUILD_ARGS }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-python-${{ matrix.wheel }}
path: bindings/python/dist/*.whl
build-nodejs:
name: build-nodejs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
with:
cache-key: bindings-nodejs-linux-x64
target: x86_64-unknown-linux-gnu
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Corepack
working-directory: bindings/nodejs
run: npm i -g --force corepack && corepack enable
- name: Install dependencies
working-directory: bindings/nodejs
run: pnpm install
- name: Build
working-directory: bindings/nodejs
shell: bash
env:
NAPI_TARGET: x86_64-unknown-linux-gnu
run: |
pnpm napi build --platform --target=$NAPI_TARGET --release --js generated.js
pnpm node ./scripts/header.js
- uses: actions/upload-artifact@v4
with:
name: bindings-nodejs
path: bindings/nodejs/*.node
integration-python:
needs: [version, build-python]
runs-on: ubuntu-latest
strategy:
matrix:
pyver: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyver }}
- name: Prepare
working-directory: tests
run: make up DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }}
- name: Download artifact
uses: actions/download-artifact@v4
with:
pattern: bindings-python-*
path: bindings/python/artifacts
merge-multiple: true
- name: Install dependencies
working-directory: bindings/python
run: |
pip install behave
if [[ "${{ matrix.pyver }}" == "3.8" ]]; then
pip install artifacts/*cp38*.whl
else
pip install artifacts/*abi3*.whl
fi
- name: Test AsyncIO
working-directory: bindings/python
run: behave tests/asyncio
- name: Test Blocking
working-directory: bindings/python
run: behave tests/blocking
- name: Test Cursor
working-directory: bindings/python
run: behave tests/cursor
integration-nodejs:
needs: [version, build-nodejs]
runs-on: ubuntu-latest
strategy:
matrix:
ver: ["18", "20", "22"]
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.ver }}
- name: Corepack
working-directory: bindings/nodejs
run: npm i -g --force corepack && corepack enable
- name: Install dependencies
working-directory: bindings/nodejs
run: pnpm install
- name: Prepare
working-directory: tests
run: make up DATABEND_QUERY_VERSION=${{ needs.version.outputs.version }}
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: bindings-nodejs
path: bindings/nodejs
- name: Run Tests
working-directory: bindings/nodejs
run: pnpm run test
notify:
if: failure()
needs: [integration, integration-python, integration-nodejs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Notify Dev Team
uses: actions/github-script@v7
env:
WEBHOOK_URL: ${{ secrets.DEV_TEAM_WEBHOOK_URL }}
with:
script: |
const body = {
msg_type: 'text',
content: {
text: '⚠️ BendSQL Integration Tests Failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
}
}
const response = await fetch(process.env.WEBHOOK_URL, {
method: 'POST',
body: JSON.stringify(body),
headers: {'Content-Type': 'application/json'}
});
const result = await response.json();
console.log(result);