Skip to content

Feat/ws/stmt2

Feat/ws/stmt2 #128

Workflow file for this run

name: Build WebSocket
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@v4
- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.31.6
- name: Build tools
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential libgeos-dev
- name: Setup Python
run: sudo apt-get install -y python3 python3-pip python-is-python3
- name: Setup Rust
id: setup-rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.90.0
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@v4
with:
path: ~/.poetry
key: ubuntu-22.04-poetry
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.5
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
poetry run pip install "numpy<2.0.0"
- name: Install library
run: |
poetry install --no-interaction --with=test
poetry run pip install "numpy<2.0.0"
- 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@v4
with:
repository: "taosdata/TDengine"
path: "TDengine_v3"
ref: ${{ steps.determine-branch.outputs.value }}
- name: Build TDengine
run: |
cd TDengine_v3
mkdir debug && cd debug
cmake .. -DBUILD_JDBC=false -DBUILD_HTTP=false -DBUILD_DEPENDENCY_TESTS=false -DWEBSOCKET=true
make -j$(nproc)
make install
- name: Start TDengine
run: |
mkdir -p /tmp/taos/log /tmp/taos/data
printf "dataDir /tmp/taos/data\nlogDir /tmp/taos/log\ndebugFlag 135\n" | sudo tee /etc/taos/taos.cfg
TAOS_SUPPORT_VNODES=256 ./TDengine_v3/debug/build/bin/taosd &
./TDengine_v3/debug/build/bin/taosadapter &
- name: Run Tests
env:
LD_LIBRARY_PATH: $PWD/TDengine/debug/build/lib
TDENGINE_URL: localhost:6041
TDENGINE_DRIVER: websocket
TDENGINE_TEST_USERNAME: ${{ secrets.TDENGINE_TEST_USERNAME }}
TDENGINE_TEST_PASSWORD: ${{ secrets.TDENGINE_TEST_PASSWORD }}
run: poetry run pytest --cov=taos --cov=taosrest tests
- name: Upload taosd logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: log-taosd
path: /tmp/taos/log
retention-days: 1
- name: Build Artifacts
run: poetry build