-
Notifications
You must be signed in to change notification settings - Fork 66
43 lines (41 loc) · 1.5 KB
/
2_build_and_test.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
name: 2- Linux 构建测试
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Linux 构建测试
run: |
sudo apt update -y
sudo apt install jq cloc protobuf-compiler -y
cloc ./
chmod 755 ./gen_info.sh
chmod +x ./gen_info.sh
chmod 755 ./gen_proto.sh
chmod +x ./gen_proto.sh
make
# for test mqtt
echo "Start Mqtt Server"
docker run -d -p 1883:1883 -p 9001:9001 eclipse-mosquitto
# for test tdengine
echo "Start TdEngine"
docker run -d --name tdengine --hostname="tdengine" -p 6030-6041:6030-6041 -p 6030-6041:6030-6041/udp tdengine/tdengine
echo "Start MongoDB"
docker run --rm -p 27017:27017 --name test-mongo -d -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=root mongo
# -------------------------------------------
# | every test
# -------------------------------------------
go test -timeout 30s -run ^TestFullyRun$ github.com/hootrhino/rulex/test -v -count=1
#
go test -timeout 30s -run ^Test_data_to_tdengine$ github.com/hootrhino/rulex/test -v -count=1
#
go test -timeout 30s -run ^Test_DataToMongo$ github.com/hootrhino/rulex/test -v -count=1