-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.4 KB
/
go.yml
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
# This workflow runs SDK related jobs for OpenMLDB
name: SDK
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
go-sdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.18'
- name: OpenMLDB cluster
run: |
docker compose -f docker-compose.yml up -d
- name: verbose services
# ensure all services is up
run: |
sleep 60
docker compose --file docker-compose.yml ps -a
- name: init test database
run: |
docker compose -f docker-compose.yml exec openmldb-ns1 /opt/openmldb/bin/openmldb --zk_cluster=openmldb-zk:2181 --zk_root_path=/openmldb --role=sql_client --cmd 'CREATE DATABASE test_db'
docker compose -f docker-compose.yml exec openmldb-ns1 /opt/openmldb/bin/openmldb --zk_cluster=openmldb-zk:2181 --zk_root_path=/openmldb --role=sql_client --cmd 'SET GLOBAL execute_mode = "online"'
- name: go test
env:
OPENMLDB_APISERVER_HOST: 127.0.0.1
OPENMLDB_APISERVER_PORT: 9527
run: go test ./... -race -covermode=atomic -coverprofile=coverage.out
- name: Coverage
uses: codecov/codecov-action@v4
with:
files: go/coverage.out
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}