-
Notifications
You must be signed in to change notification settings - Fork 14
180 lines (159 loc) · 5.94 KB
/
test-ubuntu-2204.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
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
name: Test on Ubuntu-22.04
on:
push:
branches:
- 'main'
- '3.0'
pull_request:
branches:
- 'main'
- '3.0'
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build tools
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential cmake libgeos-dev
- name: Setup Python
run: |
sudo apt-get install -y python3 python3-pip python-is-python3
- name: Build TDengine 2.x
run: |
git clone --depth 1 https://github.com/taosdata/TDengine.git -b 2.6 TDengine_v2
cd TDengine_v2
git submodule update --depth 1 --init --recursive
mkdir build
cd build
cmake ../ -DBUILD_HTTP=false -DBUILD_JDBC=false -DCMAKE_INSTALL_PREFIX:PATH=`realpath ../../local/`
make -j
cd ../../
- name: Start TDengine 2.x
run: |
tree TDengine_v2/build/build/
sudo mkdir -p /etc/taos/ || true
export C_INCLUDE_PATH=$PWD/TDengine_v2/build/build/bin
export LD_LIBRARY_PATH=$PWD/TDengine_v2/build/build/lib
mkdir -p /tmp/taos/v2/data /tmp/taos/log/v2
printf "dataDir /tmp/taos/v2/data\nlogDir /tmp/taos/v2/log\ndebugFlag 135\n" |sudo tee /etc/taos/taos.cfg
./TDengine_v2/build/build/bin/taosadapter &
./TDengine_v2/build/build/bin/taosd &
- name: Cache Poetry
id: cache-poetry
uses: actions/[email protected]
with:
path: ~/.poetry
key: ubuntu-22.04-poetry
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Test 2.x
run: |
export LD_LIBRARY_PATH=$PWD/TDengine_v2/build/build/lib
#source $VENV
export TDENGINE_URL=localhost:6041
poetry run pip install psutil "numpy<2.0.0" pandas pytest-cov
poetry run pytest tests --cov-report term --cov-report html --cov-report xml --cov=taos --cov=taosrest tests
- name: 'Upload taosd logs'
if: failure()
uses: actions/upload-artifact@v3
with:
name: taosd-log-v2
path: /tmp/taos/v2/log/
retention-days: 1
- name: Stop TDengine 2.x and clean data
run: |
kill -9 $(pidof taosd)
kill -9 $(pidof taosadapter)
rm -rf /tmp/taos/* || true
rm -rf /var/log/taos/* || true
- name: Determine TDengine branch
uses: haya14busa/action-cond@v1
id: determine-branch
with:
cond: ${{ github.base_ref == 'main' }}
if_true: 'main'
if_false: '3.0'
- name: Checkout tdengine
uses: actions/checkout@v2
with:
repository: "taosdata/TDengine"
path: "TDengine_v3"
ref: '3.0'
- name: Build TDengine 3.0
run: |
pwd
git branch -vv
cd TDengine_v3
rm build -rf
mkdir build
cd build
cmake ../ -DBUILD_JDBC=false -DBUILD_CONTRIB=false -DBUILD_DEPENDENCY_TESTS=false -DCMAKE_INSTALL_PREFIX:PATH=`realpath ../../local/` -DBUILD_HTTP=false
make -j4
sudo make install
ls -alh /etc/taos/
cd ../../
- name: Start TDengine 3.0
run: |
tree TDengine_v3/build/build/
export C_INCLUDE_PATH=$PWD/TDengine_v3/build/build/bin
export LD_LIBRARY_PATH=$PWD/TDengine_v3/build/build/lib
mkdir -p /tmp/taos/v3/log /tmp/taos/v3/data
printf "dataDir /tmp/taos/v3/data\nlogDir /tmp/taos/v3/log\ndebugFlag 135\n" |sudo tee /etc/taos/taos.cfg
TAOS_SUPPORT_VNODES=256 ./TDengine_v3/build/build/bin/taosd &
./TDengine_v3/build/build/bin/taosadapter &
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Test 3.0
run: |
export LD_LIBRARY_PATH=$PWD/TDengine_v3/build/build/lib
#source $VENV
export TDENGINE_URL=localhost:6041
curl -L -H "Authorization: Basic cm9vdDp0YW9zZGF0YQ==" -d "show databases" localhost:6041/rest/sql
poetry run pip install psutil "numpy<2.0.0" pandas pytest-cov
poetry run pytest --cov-report term --cov-report html --cov-report xml --cov=taos --cov=taosrest --cov-append tests
- name: 'Upload taosd logs'
if: failure()
uses: actions/upload-artifact@v3
with:
name: log-v3-taosd
path: /tmp/taos/v3/log/
retention-days: 1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: false
- name: Build Artifacts
run: |
poetry build