Merge pull request #198 from taosdata/fix/stmt/lengthoffset #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: push | |
on: | |
push: | |
branches: | |
- 'main' | |
- '3.0' | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
name: Build | |
outputs: | |
commit_id: ${{ steps.get_commit_id.outputs.commit_id }} | |
steps: | |
- name: checkout TDengine | |
uses: actions/checkout@v3 | |
with: | |
repository: 'taosdata/TDengine' | |
path: 'TDengine' | |
ref: ${{ github.ref_name }} | |
- name: get_commit_id | |
id: get_commit_id | |
run: | | |
cd TDengine | |
echo "commit_id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Cache server | |
id: cache-server | |
uses: actions/cache@v3 | |
with: | |
path: server.tar.gz | |
key: ${{ runner.os }}-build-${{ github.ref_name }}-${{ steps.get_commit_id.outputs.commit_id }} | |
- name: prepare install | |
if: steps.cache-server.outputs.cache-hit != 'true' | |
run: sudo apt install -y libgeos-dev | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: install TDengine | |
if: steps.cache-server.outputs.cache-hit != 'true' | |
run: | | |
cd TDengine | |
mkdir debug | |
cd debug | |
cmake .. -DBUILD_JDBC=false -DBUILD_TEST=off -DBUILD_HTTP=false -DVERNUMBER=3.9.9.9 -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache | |
make -j 4 | |
- name: package | |
if: steps.cache-server.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ./release | |
cp ./TDengine/debug/build/bin/taos ./release/ | |
cp ./TDengine/debug/build/bin/taosd ./release/ | |
cp ./TDengine/tools/taosadapter/taosadapter ./release/ | |
cp ./TDengine/debug/build/lib/libtaos.so.3.9.9.9 ./release/ | |
cp ./TDengine/debug/build/lib/librocksdb.so.8.1.1 ./release/ ||: | |
cp ./TDengine/include/client/taos.h ./release/ | |
cat >./release/install.sh<<EOF | |
chmod +x ./taos | |
chmod +x ./taosd | |
chmod +x ./taosadapter | |
cp ./taos /bin/ | |
cp ./taosd /bin/ | |
cp ./taosadapter /bin/ | |
cp ./libtaos.so.3.9.9.9 /usr/lib | |
cp ./librocksdb.so.8.1.1 /usr/lib ||: | |
ln -sf /usr/lib/libtaos.so.3.9.9.9 /usr/lib/libtaos.so.1 | |
ln -sf /usr/lib/libtaos.so.1 /usr/lib/libtaos.so | |
ln -sf /usr/lib/librocksdb.so.8.1.1 /usr/lib/librocksdb.so.8 ||: | |
ln -sf /usr/lib/librocksdb.so.8 /usr/lib/librocksdb.so ||: | |
cp ./taos.h /usr/include | |
EOF | |
tar -zcvf server.tar.gz ./release | |
test: | |
runs-on: ubuntu-20.04 | |
needs: build | |
strategy: | |
matrix: | |
go: [ '1.14', '1.19' ] | |
name: Go ${{ matrix.go }} | |
steps: | |
- name: get cache server | |
id: get-cache-server | |
uses: actions/cache@v3 | |
with: | |
path: server.tar.gz | |
key: ${{ runner.os }}-build-${{ github.ref_name }}-${{ needs.build.outputs.commit_id }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ github.ref_name }}- | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
path: 'driver-go' | |
- name: prepare install | |
run: sudo apt install -y libgeos-dev | |
- name: install | |
run: | | |
tar -zxvf server.tar.gz | |
cd release && sudo sh install.sh | |
- name: shell | |
run: | | |
cat >start.sh<<EOF | |
ulimit -n 65535 && TAOS_SUPPORT_VNODES=256 taosd | |
EOF | |
- name: taosd | |
run: nohup sudo sh ./start.sh & | |
- name: start taosadapter | |
run: sudo taosadapter & | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
cache-dependency-path: driver-go/go.sum | |
- name: Test | |
run: cd ./driver-go && go test -v ./... |