Skip to content

Commit 6e85c58

Browse files
committed
feat: add deploy-taostest-testng.yml
1 parent 9e42878 commit 6e85c58

File tree

3 files changed

+139
-46
lines changed

3 files changed

+139
-46
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Deploy taostest and TestNG
2+
description: Deploy taostest and TestNG
3+
4+
inputs:
5+
res_app_id:
6+
description: 'GitHub App ID'
7+
required: true
8+
res_app_key:
9+
description: 'GitHub App Key'
10+
required: true
11+
taostest-branch:
12+
description: 'Branch of taostest'
13+
required: true
14+
default: 'master'
15+
testng-branch:
16+
description: 'Branch of TestNG'
17+
required: true
18+
default: 'master'
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v3
25+
26+
- name: Install Rust
27+
uses: actions-rust-lang/setup-rust-toolchain@v1
28+
with:
29+
toolchain: ${{ inputs.rust-version }}
30+
31+
- name: Generate GitHub App Token
32+
id: app-token
33+
uses: tibdex/github-app-token@v1
34+
with:
35+
app_id: ${{ inputs.res_app_id }}
36+
private_key: ${{ inputs.res_app_key }}
37+
38+
- name: Set GitHub App Token as secret
39+
run: echo "GITHUB_APP_TOKEN=${{ steps.app-token.outputs.token }}" >> $GITHUB_ENV
40+
shell: bash
41+
42+
43+
- name: Check out taos-test-framework private repository
44+
uses: actions/checkout@v4
45+
with:
46+
repository: taosdata/taos-test-framework
47+
token: ${{ env.GITHUB_APP_TOKEN }}
48+
path: taos-test-framework
49+
ref: ${{ inputs.taostest-branch }}
50+
clean: ''
51+
52+
- name: Set up Python and dependencies
53+
shell: bash
54+
run: |
55+
apt-get update
56+
apt install -y python3-pip
57+
pip3 install poetry
58+
59+
- name: Run reinstall script
60+
shell: bash
61+
working-directory: ./taos-test-framework
62+
run: |
63+
yes | bash reinstall.sh
64+
mkdir -p ~/.taostest
65+
touch ~/.taostest/.env
66+
67+
- name: Install Python packages
68+
shell: bash
69+
run: pip3 install --upgrade numpy pandas
70+
71+
- name: Check out TestNG private repository
72+
uses: actions/checkout@v4
73+
with:
74+
repository: taosdata/TestNG
75+
token: ${{ env.GITHUB_APP_TOKEN }}
76+
path: TestNG
77+
ref: ${{ inputs.testng-branch }}
78+
clean: ''
79+
80+
81+
82+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Deploy Taostest and TestNG
2+
3+
on:
4+
push:
5+
branches:
6+
- test/fractal
7+
8+
jobs:
9+
deploy-mqtt-client:
10+
runs-on:
11+
group: fractal
12+
labels:
13+
- self-hosted
14+
- Linux
15+
- X64
16+
- fractal
17+
- mqtt_client1
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Install Taostest And TestNG
23+
uses: taosdata/.github/.github/actions/install-taostest-testng@test/fractal
24+
with:
25+
res_app_id: ${{ vars.RES_APP_ID }}
26+
res_app_key: ${{ secrets.RES_APP_KEY }}

.github/workflows/update-hosts.yml

Lines changed: 31 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,8 @@ on:
44
push:
55
branches:
66
- test/fractal
7-
87
# on:
98
# workflow_dispatch:
10-
# inputs:
11-
# version:
12-
# description: 'Enter the version of TDengine to install'
13-
# required: true
14-
# default: '3.3.5.1'
15-
# group:
16-
# description: 'Enter the group for the runner'
17-
# required: true
18-
# default: 'default'
19-
# dnode_count:
20-
# description: 'Number of nodes to deploy'
21-
# required: true
22-
# default: '2'
239

2410
permissions:
2511
actions: read
@@ -119,7 +105,7 @@ jobs:
119105
echo "td_runner_names=${td_runner_names}" >> $GITHUB_OUTPUT
120106
fi
121107
122-
update-hosts:
108+
upload-hosts-info:
123109
needs: filter-runners
124110

125111
strategy:
@@ -139,14 +125,14 @@ jobs:
139125
run: |
140126
echo "🔄 Getting IP and hostname for the runner..."
141127
142-
# 获取 IP 和主机名
143-
ip=$(hostname -I | awk '{print $1}') # 获取 IP 地址
144-
hostname=$(hostname) # 获取主机名
128+
# Get IP and hostname
129+
ip=$(hostname -I | awk '{print $1}')
130+
hostname=$(hostname)
145131
146132
echo "IP: $ip"
147133
echo "Hostname: $hostname"
148134
149-
# IP 和主机名保存为输出
135+
# Save IP and hostname to a file
150136
echo "$ip $hostname" > ip_hostname_${{ matrix.runner.name }}.txt
151137
152138
- name: Upload IP and Hostname Info
@@ -157,7 +143,7 @@ jobs:
157143

158144
combine-and-update-hosts:
159145
needs:
160-
- update-hosts
146+
- upload-hosts-info
161147
- filter-runners
162148
strategy:
163149
matrix:
@@ -198,10 +184,10 @@ jobs:
198184
run: |
199185
echo "🔄 Combining IP and hostname info..."
200186
201-
# 读取所有 runner 的 IP 和主机名信息
202-
ip_hostname_info=$(cat ip_hostname/*.txt | sort | uniq) # 去重
187+
# Read all files in the ip_hostname directory and combine them
188+
ip_hostname_info=$(cat ip_hostname/*.txt | sort | uniq)
203189
204-
# 将所有信息保存为环境变量,供后续步骤使用
190+
# Save the combined IP and hostname info to an environment variable
205191
echo "ip_hostname_info<<EOF" >> $GITHUB_ENV
206192
echo -e "$ip_hostname_info" >> $GITHUB_ENV
207193
echo "EOF" >> $GITHUB_ENV
@@ -210,11 +196,10 @@ jobs:
210196
run: |
211197
echo "🔄 Updating /etc/hosts..."
212198
213-
# 遍历 ip_hostname_info 的每一行
214199
while IFS= read -r line; do
215-
# 检查 /etc/hosts 中是否已经存在该行
200+
# Check if the line already exists in /etc/hosts
216201
if ! grep -Fxq "$line" /etc/hosts; then
217-
# 如果不存在,则追加到 /etc/hosts
202+
# Append the line to /etc/hosts if it doesn't exist
218203
echo "$line" | sudo tee -a /etc/hosts
219204
else
220205
echo "✅ Skipping (already exists): $line"
@@ -224,24 +209,24 @@ jobs:
224209
echo "✅ Updated /etc/hosts with runner IPs and hostnames:"
225210
cat /etc/hosts
226211
227-
install-tdengine:
228-
needs:
229-
- combine-and-update-hosts
230-
- filter-runners
231-
strategy:
232-
matrix:
233-
runner: ${{ fromJson(needs.filter-runners.outputs.td_runners || '[]') }}
234-
runs-on:
235-
group: ${{ matrix.runner.group }}
236-
labels: ${{ matrix.runner.labels }}
237-
steps:
238-
- name: Print Runner Info
239-
run: |
240-
echo "🔄 Running on group: ${{ matrix.runner.group }}"
241-
242-
- name: Install TDengine Enterprise
243-
uses: taosdata/.github/.github/actions/install-tdengine-enterprise@fractal
244-
with:
245-
version: 3.3.5.0
246-
nas_download_url: ${{ secrets.NAS_DOWNLOAD_URL }}
212+
# install-tdengine:
213+
# needs:
214+
# - combine-and-update-hosts
215+
# - filter-runners
216+
# strategy:
217+
# matrix:
218+
# runner: ${{ fromJson(needs.filter-runners.outputs.td_runners || '[]') }}
219+
# runs-on:
220+
# group: ${{ matrix.runner.group }}
221+
# labels: ${{ matrix.runner.labels }}
222+
# steps:
223+
# - name: Print Runner Info
224+
# run: |
225+
# echo "🔄 Running on group: ${{ matrix.runner.group }}"
226+
227+
# - name: Install TDengine Enterprise
228+
# uses: taosdata/.github/.github/actions/install-tdengine-enterprise@fractal
229+
# with:
230+
# version: 3.3.5.0
231+
# nas_download_url: ${{ secrets.NAS_DOWNLOAD_URL }}
247232

0 commit comments

Comments
 (0)