enh: websocket reconnect #66
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: TEST_LINUX | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
- '3.0' | |
- '3.1' | |
push: | |
branches: | |
- 'main' | |
- '3.0' | |
- '3.1' | |
workflow_dispatch: | |
inputs: | |
tbBranch: | |
description: 'TDengine branch' | |
required: true | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
name: Build | |
outputs: | |
commit_id: ${{ steps.get_commit_id.outputs.commit_id }} | |
steps: | |
- name: checkout TDengine by pr | |
if: github.event_name == 'pull_request' | |
uses: actions/checkout@v4 | |
with: | |
repository: 'taosdata/TDengine' | |
path: 'TDengine' | |
ref: ${{ github.base_ref }} | |
- name: checkout TDengine by push | |
if: github.event_name == 'push' | |
uses: actions/checkout@v4 | |
with: | |
repository: 'taosdata/TDengine' | |
path: 'TDengine' | |
ref: ${{ github.ref_name }} | |
- name: checkout TDengine manually | |
if: github.event_name == 'workflow_dispatch' | |
uses: actions/checkout@v4 | |
with: | |
repository: 'taosdata/TDengine' | |
path: 'TDengine' | |
ref: ${{ inputs.tbBranch }} | |
- name: get_commit_id | |
id: get_commit_id | |
run: | | |
cd TDengine | |
echo "commit_id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
- name: Cache server by pr | |
if: github.event_name == 'pull_request' | |
id: cache-server-pr | |
uses: actions/cache@v4 | |
with: | |
path: server.tar.gz | |
key: ${{ runner.os }}-build-${{ github.base_ref }}-${{ steps.get_commit_id.outputs.commit_id }} | |
- name: Cache server by push | |
if: github.event_name == 'push' | |
id: cache-server-push | |
uses: actions/cache@v4 | |
with: | |
path: server.tar.gz | |
key: ${{ runner.os }}-build-${{ github.ref_name }}-${{ steps.get_commit_id.outputs.commit_id }} | |
- name: Cache server manually | |
if: github.event_name == 'workflow_dispatch' | |
id: cache-server-manually | |
uses: actions/cache@v4 | |
with: | |
path: server.tar.gz | |
key: ${{ runner.os }}-build-${{ inputs.tbBranch }}-${{ steps.get_commit_id.outputs.commit_id }} | |
- name: install TDengine | |
if: > | |
(github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') || | |
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true') || | |
(github.event_name == 'push' && steps.cache-server-push.outputs.cache-hit != 'true') | |
run: | | |
cd TDengine | |
mkdir debug | |
cd debug | |
cmake .. -DBUILD_TEST=off -DBUILD_HTTP=false -DVERNUMBER=3.9.9.9 | |
make -j8 | |
- name: package | |
if: > | |
(github.event_name == 'workflow_dispatch' && steps.cache-server-manually.outputs.cache-hit != 'true') || | |
(github.event_name == 'pull_request' && steps.cache-server-pr.outputs.cache-hit != 'true') || | |
(github.event_name == 'push' && steps.cache-server-push.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 | |
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_build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
dotnet: [ '6.0.x', '5.0.x' ] | |
name: Build C# ${{ matrix.dotnet }} | |
steps: | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
path: 'csharp-driver' | |
- name: Restore dependencies | |
run: | | |
cd csharp-driver | |
echo `pwd` | |
ls -al | |
dotnet restore | |
- name: Build C# Driver | |
run: | | |
cd csharp-driver | |
dotnet build --no-restore | |
echo `pwd` | |
ls -al | |
test_unit: | |
runs-on: ubuntu-20.04 | |
needs: build | |
strategy: | |
matrix: | |
dotnet: [ '6.0.x', '5.0.x' ] | |
name: test unit ${{ matrix.dotnet }} | |
steps: | |
- name: get cache server by pr | |
if: github.event_name == 'pull_request' | |
id: get-cache-server-pr | |
uses: actions/cache@v4 | |
with: | |
path: server.tar.gz | |
key: ${{ runner.os }}-build-${{ github.base_ref }}-${{ needs.build.outputs.commit_id }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ github.base_ref }}- | |
- name: get cache server by push | |
if: github.event_name == 'push' | |
id: get-cache-server-push | |
uses: actions/cache@v4 | |
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: get cache server manually | |
if: github.event_name == 'workflow_dispatch' | |
id: get-cache-server-manually | |
uses: actions/cache@v4 | |
with: | |
path: server.tar.gz | |
key: ${{ runner.os }}-build-${{ inputs.tbBranch }}-${{ needs.build.outputs.commit_id }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ inputs.tbBranch }}- | |
- name: install | |
run: | | |
tar -zxvf server.tar.gz | |
cd release && sudo sh install.sh | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: copy taos cfg | |
run: | | |
sudo mkdir -p /etc/taos | |
sudo cp ./.github/workflows/taos.cfg /etc/taos/taos.cfg | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- name: Restore dependencies | |
run: | | |
ls -al | |
dotnet restore | |
- name: start shell | |
run: | | |
cat >start.sh<<EOF | |
ulimit -n 65535 && TAOS_SUPPORT_VNODES=256 taosd | |
EOF | |
- name: start taosd | |
run: nohup sudo sh ./start.sh & | |
- name: start taosadapter | |
run: sudo taosadapter & | |
- name: test | |
id: test | |
run: | | |
sudo dotnet test --logger "console;verbosity=detailed" --collect:"XPlat Code Coverage" --results-directory:./testresults | |
timeout-minutes: 15 | |
- uses: actions/upload-artifact@v3 | |
if: always() && (steps.test.outcome == 'failure' || steps.test.outcome == 'cancelled') | |
with: | |
name: ${{ runner.os }}-${{ matrix.go }}-log | |
path: /var/log/taos/ | |
- name: get coverage files | |
id: get_coverage_files | |
run: | | |
COVERAGE_FILES=$(find ./testresults -name 'coverage.cobertura.xml' -exec printf "%s;" {} +) | |
COVERAGE_FILES=${COVERAGE_FILES%;} | |
echo "files=${COVERAGE_FILES}" >> $GITHUB_OUTPUT | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.go }} == '6.0.x' | |
uses: codecov/codecov-action@v4-beta | |
with: | |
files: ${{ steps.get_coverage_files.outputs.files }} | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }} |