Skip to content

Commit 947f336

Browse files
authored
Merge pull request databendlabs#328 from databendlabs/feat/cron-inte-ci
feat: add cron integration ci
2 parents bd243fd + 5981e44 commit 947f336

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Daily Integration Tests
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
pull_request:
8+
branches:
9+
- main
10+
paths:
11+
- '.github/workflows/cron.integration.yml'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
services:
21+
databend:
22+
image: datafuselabs/databend:nightly
23+
env:
24+
QUERY_DEFAULT_USER: databend
25+
QUERY_DEFAULT_PASSWORD: databend
26+
MINIO_ENABLED: true
27+
ports:
28+
- 8000:8000
29+
- 9000:9000
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.ref }}
35+
36+
- name: Set up JDK 17
37+
uses: actions/setup-java@v4
38+
with:
39+
distribution: 'temurin'
40+
java-version: '17'
41+
cache: 'maven'
42+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import
43+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
44+
45+
- name: Verify Service Running
46+
run: |
47+
sleep 30
48+
cid=$(docker ps -a | grep databend | cut -d' ' -f1)
49+
docker logs ${cid}
50+
curl -u databend:databend --request POST localhost:8000/v1/query --header 'Content-Type:application/json' --data-raw '{"sql":"select 1"}'
51+
52+
- name: Run Maven clean deploy with release profile
53+
run: mvn test -DexcludedGroups=cluster,FLAKY
54+
env:
55+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
56+
notify:
57+
if: failure()
58+
needs: [ test ]
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
- name: Notify Dev Team
63+
uses: actions/github-script@v7
64+
env:
65+
WEBHOOK_URL: ${{ secrets.DEV_TEAM_WEBHOOK_URL }}
66+
with:
67+
script: |
68+
const body = {
69+
msg_type: 'text',
70+
content: {
71+
text: '⚠️ Databend JDBC Integration Tests Failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}',
72+
}
73+
}
74+
const response = await fetch(process.env.WEBHOOK_URL, {
75+
method: 'POST',
76+
body: JSON.stringify(body),
77+
headers: {'Content-Type': 'application/json'}
78+
});
79+
const result = await response.json();
80+
console.log(result);

0 commit comments

Comments
 (0)