Skip to content

feat: tmq supports token (#385) #71

feat: tmq supports token (#385)

feat: tmq supports token (#385) #71

name: taos-ws-py-enterprise
on:
push:
branches:
- "main"
- "3.0"
tags:
- taos-ws-py-v*
pull_request:
branches:
- "main"
- "3.0"
env:
PYTHON_VERSION: "3.10"
jobs:
rebuild:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.set-output.outputs.rebuild }}
git_commit_id: ${{ steps.output.outputs.git_commit_id }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect file changes for rebuild
if: "!startsWith(github.ref, 'refs/tags/taos-ws-py')"
id: detect-changes
uses: tj-actions/changed-files@v46
with:
files: |
.github/workflows/taos-ws-py*.yml
taos-ws-py/**
- name: Set rebuild status
id: set-output
run: |
if [[ "${GITHUB_REF}" == refs/tags/taos-ws-py* ]]; then
echo "rebuild=true" >> $GITHUB_OUTPUT
else
echo "rebuild=${{ steps.detect-changes.outputs.any_changed }}" >> $GITHUB_OUTPUT
fi
- id: output
run: echo "git_commit_id=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
test:
runs-on: ubuntu-latest
needs: rebuild
if: needs.rebuild.outputs.status == 'true'
timeout-minutes: 30
strategy:
matrix:
target: [x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"
architecture: x64
- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.31.6
- name: Build taos-ws-py wheel
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.target }}
working-directory: taos-ws-py
manylinux: auto
args: --release --strip
docker-options: -e GIT_COMMIT_ID=${{ needs.rebuild.outputs.git_commit_id }}
- name: Install taos-ws-py wheel
run: pip install taos-ws-py --no-index --force-reinstall --find-links taos-ws-py/target/wheels
- name: Get TDengine
run: wget "${{ secrets.NIGHTLY_TDENGINE_ENTERPRISE_BASE_URL }}/tsdb-nightly-3.0.tar.gz?v=$(date +%s)" -O tsdb-nightly-3.0.tar.gz
- name: Install TDengine
run: |
tar -zxf tsdb-nightly-3.0.tar.gz
rm -rf tsdb-nightly-3.0.tar.gz
cd tsdb-nightly-3.0
sudo ./install.sh
- name: Copy taos.cfg
run: |
sudo mkdir -p /etc/taos
sudo cp ./.github/workflows/taos.cfg /etc/taos/taos.cfg
- name: Set timezone
run: sudo timedatectl set-timezone Asia/Shanghai
- name: Start TDengine
run: |
sudo mkdir -p /var/log/taos
taosd &
taosadapter &
- name: Run tests
env:
TDENGINE_URL: localhost:6041
TDENGINE_TEST_USERNAME: ${{ secrets.WS_TDENGINE_TEST_USERNAME }}
TDENGINE_TEST_PASSWORD: ${{ secrets.WS_TDENGINE_TEST_PASSWORD }}
WS_CLOUD_URL: ${{ secrets.WS_CLOUD_URL }}
WS_CLOUD_TOKEN: ${{ secrets.WS_CLOUD_TOKEN }}
TEST_TD_ENTERPRISE: "true"
run: |
pip3 install pytest toml
pytest ./taos-ws-py/tests/