1818 - ' *.md'
1919 - ' *.txt'
2020
21+ env :
22+ CACHE_VERSION : v1 # Update this version when cache strategy needs refresh
23+
2124jobs :
2225 build :
2326 strategy :
2427 matrix :
25- # os: [ ubuntu-latest,macos-latest,windows-latest ]
2628 os : [ Ubuntu-22.04 ]
2729 java : [ 8 ]
2830 maven : [ '3.6.3' ]
2931 runs-on : ${{ matrix.os }}
3032 steps :
31- - name : checkout TDengine
33+ - name : Checkout TDengine
3234 uses : actions/checkout@v3
3335 with :
3436 repository : ' taosdata/TDengine'
3537 path : ' TDengine'
36- ref : ${{ github.base_ref }}
38+ ref : ${{ github.event.pull_request.base.ref || github.ref_name }}
39+
40+ - name : Get TDengine branch and commit info
41+ id : tdengine-info
42+ run : |
43+ cd TDengine
44+ echo "commit_id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
45+ echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT
46+ echo "short_sha=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT
47+
48+ - name : Restore TDengine debug directory cache
49+ uses : actions/cache/restore@v4
50+ id : restore-cache
51+ with :
52+ path : TDengine/debug
53+ key : ${{ runner.os }}-tdengine-debug-${{ env.CACHE_VERSION }}-${{ steps.tdengine-info.outputs.branch }}-${{ steps.tdengine-info.outputs.commit_id }}
54+ restore-keys : |
55+ ${{ runner.os }}-tdengine-debug-${{ env.CACHE_VERSION }}-${{ steps.tdengine-info.outputs.branch }}-
56+ ${{ runner.os }}-tdengine-debug-${{ env.CACHE_VERSION }}-
57+
58+ - name : Install build dependencies
59+ if : steps.cache-debug-dir.outputs.cache-hit != 'true'
60+ run : |
61+ sudo apt-get update
62+ sudo apt-get install -y libgeos-dev build-essential cmake gcc g++ make
63+
64+ - name : Build TDengine (if cache missed)
65+ if : steps.cache-debug-dir.outputs.cache-hit != 'true'
66+ id : build-step
67+ run : |
68+ cd TDengine
69+ mkdir -p debug
70+ cd debug
71+ cmake .. -DBUILD_JDBC=false -DBUILD_TOOLS=false -DBUILD_HTTP=false -DBUILD_DEPENDENCY_TESTS=false
72+ make -j $(nproc)
73+
74+ - name : Save cache on build success
75+ if : always() && steps.build-step.conclusion == 'success'
76+ uses : actions/cache/save@v4
77+ with :
78+ path : TDengine/debug
79+ key : ${{ runner.os }}-tdengine-debug-${{ env.CACHE_VERSION }}-${{ steps.tdengine-info.outputs.branch }}-${{ steps.tdengine-info.outputs.commit_id }}
3780
38- - name : prepare install
39- run : |
40- sudo apt-get install -y libgeos-dev
41- geos-config --version
42-
43- - name : install TDengine
44- run : cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_JDBC=false -DBUILD_TOOLS=false -DBUILD_HTTP=false -DBUILD_DEPENDENCY_TESTS=false && make && sudo make install
81+
82+ - name : Verify debug directory
83+ run : |
84+ echo "=== Verifying debug directory ==="
85+ if [ ! -d "TDengine/debug" ]; then
86+ echo "❌ Error: Debug directory not found!"
87+ exit 1
88+ fi
89+
90+ echo "Debug directory contents:"
91+ ls -la TDengine/debug/
92+
93+ if [ ! -d "TDengine/debug/build" ]; then
94+ echo "❌ Error: Build directory not found in debug directory!"
95+ exit 1
96+ fi
97+
98+ file_count=$(find TDengine/debug/build -type f 2>/dev/null | wc -l)
99+ echo "✅ Build directory exists with $file_count files"
100+
101+ - name : Install TDengine from debug directory
102+ run : |
103+ echo "=== Installing TDengine ==="
104+ if [ ! -d "TDengine/debug" ]; then
105+ echo "❌ Error: Debug directory not found for installation!"
106+ exit 1
107+ fi
108+
109+ cd TDengine/debug
110+ echo "Running make install..."
111+ if ! sudo make install; then
112+ echo "❌ Error: make install failed!"
113+ exit 1
114+ fi
115+ echo "✅ TDengine installed successfully"
116+
117+ - name : Verify TDengine installation
118+ run : |
119+ echo "=== Verifying TDengine installation ==="
120+
121+ # Check taosd
122+ if ! which taosd >/dev/null 2>&1; then
123+ echo "❌ Error: taosd not found in PATH!"
124+ exit 1
125+ fi
126+ echo "✅ taosd found: $(which taosd)"
127+ taosd --version || echo "⚠️ Could not get taosd version"
128+
129+ # Check taos
130+ if ! which taos >/dev/null 2>&1; then
131+ echo "❌ Error: taos not found in PATH!"
132+ exit 1
133+ fi
134+ echo "✅ taos found: $(which taos)"
135+ taos --version || echo "⚠️ Could not get taos version"
136+
137+ # Check installation directories
138+ if [ -d "/usr/local/taos/bin" ]; then
139+ echo "✅ TDengine binaries in /usr/local/taos/bin:"
140+ ls -la /usr/local/taos/bin/
141+ else
142+ echo "⚠️ /usr/local/taos/bin/ not found"
143+ fi
144+
145+ echo "✅ TDengine installation verified"
45146
46147 - name : shell
47148 run : |
48149 cat >start.sh<<EOF
49150 ulimit -n 65535 && TAOS_SUPPORT_VNODES=256 taosd
50151 EOF
51-
52152 - name : taosd
53153 run : nohup sudo sh ./start.sh &
54154
55155 - name : start taosadapter
56156 run : sudo taosadapter &
57157
58- - name : checkout
158+ - name : Check service status
159+ run : |
160+ echo "=== Checking service status ==="
161+
162+ # Check taos processes
163+ if ! pgrep -f "[t]aosd" >/dev/null 2>&1; then
164+ echo "❌ Error: No taosd process found!"
165+ echo "taosd log:"
166+ sudo tail -20 /var/log/taosd.log 2>/dev/null || echo "No taosd log found"
167+ exit 1
168+ fi
169+ echo "✅ taosd process is running"
170+
171+ if ! pgrep -f "[t]aosadapter" >/dev/null 2>&1; then
172+ echo "❌ Error: No taosadapter process found!"
173+ echo "taosadapter log:"
174+ sudo tail -20 /var/log/taosadapter.log 2>/dev/null || echo "No taosadapter log found"
175+ exit 1
176+ fi
177+ echo "✅ taosadapter process is running"
178+
179+ # Check port 6030
180+ if ! sudo netstat -tlnp | grep -q 6030; then
181+ echo "❌ Error: Port 6030 not listening!"
182+ echo "Current listening ports:"
183+ sudo netstat -tlnp | grep LISTEN || echo "No listening ports found"
184+ exit 1
185+ fi
186+ echo "✅ Port 6030 is listening"
187+
188+ # Additional connectivity test
189+ echo "Testing TDengine connectivity..."
190+ if ! timeout 10s taos -s "show dnodes" >/dev/null 2>&1; then
191+ echo "❌ Error: Cannot connect to TDengine!"
192+ echo "Service status:"
193+ ps aux | grep -E "[t]aos"
194+ echo "Port check:"
195+ sudo netstat -tlnp | grep -E "6030|6060" || echo "No TDengine ports found"
196+ exit 1
197+ fi
198+
199+ echo "✅ All services are running correctly"
200+ - name : Checkout JDBC connector
59201 uses : actions/checkout@v4
60202 with :
61203 path : ' jdbc-workspace'
62204
63- - name : set up java
205+ - name : Set up Java
64206 uses : actions/setup-java@v3
65207 with :
66- distribution : ' temurin' # See 'Supported distributions' for available options
208+ distribution : ' temurin'
67209 java-version : ${{ matrix.java }}
68210 java-package : jdk
211+ cache : ' maven'
69212
70- - name : Test
213+ - name : Run JDBC tests
71214 working-directory : jdbc-workspace
72215 env :
73216 TDENGINE_CLOUD_URL : ${{ secrets.TDENGINE_CLOUD_URL }}
@@ -84,5 +227,12 @@ jobs:
84227 verbose : true
85228 root_dir : jdbc-workspace
86229
87-
88-
230+ - name : Upload logs on failure
231+ if : failure()
232+ uses : actions/upload-artifact@v4
233+ with :
234+ name : service-logs
235+ path : |
236+ /var/log/taosd.log
237+ /var/log/taosadapter.log
238+ retention-days : 1
0 commit comments