-
Notifications
You must be signed in to change notification settings - Fork 17
121 lines (104 loc) · 3.28 KB
/
taos-ws-py-enterprise.yml
File metadata and controls
121 lines (104 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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/