-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d19e82c
commit e0b2af3
Showing
4 changed files
with
406 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
name: Ubuntu (3.0 taosbenchmark debug) | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
env: | ||
TOOLS_BUILD_TYPE: Debug | ||
PR_NUMBER: ${{ github.event.number }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Step that prints name of pull request's base branch | ||
run: | | ||
echo "Pull request's base branch is: ${BASE_BRANCH}" | ||
echo "Pull request's branch is: ${GITHUB_REF##*/}" | ||
echo "Pull request's head ref is: ${GITHUB_HEAD_REF}" | ||
env: | ||
BASE_BRANCH: ${{ github.base_ref }} | ||
if: github.event_name == 'pull_request' | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v23.2 | ||
|
||
- name: List all changed files | ||
run: | | ||
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | ||
echo "$file was changed" | ||
done | ||
- name: Get specific changed files | ||
id: changed-files-specific | ||
uses: tj-actions/changed-files@v23.2 | ||
with: | ||
files: | | ||
src/bench* | ||
inc/* | ||
tests/taosbenchmark/ws/* | ||
packaging/tools/* | ||
.github/workflows/3.0-taosBenchmark-release.yml | ||
- name: Run step if any of the listed files above change | ||
if: steps.changed-files-specific.outputs.any_changed == 'true' | ||
run: | | ||
echo "One or more files listed above has changed." | ||
- name: Checkout TDengine 3.0 | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'taosdata/TDengine' | ||
path: 'TDengine' | ||
ref: '3.0' | ||
|
||
- name: Change time zone | ||
if: | | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
sudo timedatectl set-timezone Asia/Shanghai | ||
sudo date | ||
- name: Set up Go | ||
if: | | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.14 | ||
|
||
- name: Set up Rust | ||
if: | | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- uses: actions/cache@v3 | ||
id: cache-rust | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
key: ${{ runner.os }}-cargo-${{ steps.setup-rust.outputs.rustc_hash }} | ||
|
||
- name: Build & Install TDengine | ||
if: | | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_HTTP=false -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null && cd .. && rm -rf debug | ||
if [[ ! -f /usr/local/taos/bin/taosd ]] || [[ ! -f /usr/local/taos/bin/taosadapter ]] | ||
then | ||
echo "TDengine build failure" | ||
exit 1 | ||
fi | ||
- name: Install packages for build taos-tools | ||
if: | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
sudo apt update > /dev/null | ||
sudo apt install lzma-dev liblzma-dev libjansson-dev libz-dev libsnappy-dev pkg-config expect -y > /dev/null | ||
- name: Checkout taos-tools to PR number | ||
if: | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
run: | | ||
git fetch origin +refs/pull/${{env.PR_NUMBER}}/merge | ||
git checkout -qf FETCH_HEAD | ||
- name: Build taos-tools | ||
if: | | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
mkdir debug ||: | ||
cd debug | ||
cmake .. -DTOOLS_BUILD_TYPE=Debug -DTOOLS_SANITIZE=true -DWEBSOCKET=true > /dev/null && make -j8 > /dev/null && sudo make install > /dev/null | ||
if [[ ! -f /usr/local/taos/bin/taosdump ]] || [[ ! -f /usr/local/taos/bin/taosBenchmark ]] | ||
then | ||
echo "taos-tools build failure" | ||
exit 1 | ||
fi | ||
- name: Install python packages | ||
if: | | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
pip3 install numpy fabric2 psutil pandas faker toml > /dev/null 2>&1 | ||
pip3 install git+https://github.com/taosdata/taos-connector-python > /dev/null | ||
- name: Test | ||
if: | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
cd tests | ||
if find taosbenchmark -name "*.py"|grep -q .; | ||
then | ||
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|taosdemo|kill-slow-query"|sort`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e " \033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done | ||
fi | ||
- name: Test WebSocket | ||
if: | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
#cd tests | ||
#if find taosbenchmark/ws -name "*.py"|grep -q .; | ||
#then | ||
# for i in `find taosbenchmark/ws -name "*.py"`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m benchmark-ws-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-ws-test:$i failed! \033[0m" | tee -a ~/benchmark-ws-failed.txt; done | ||
#fi | ||
- name: Test taosdemo query | ||
if: | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
cd tests | ||
if find taosbenchmark -name "taosdemo*.py"|grep -q .; | ||
then | ||
for i in `find taosbenchmark -name "taosdemo*.py"`; do printf $i && python3 ./test.py -f $i && echo -e "\033[32m $i success! \033[0m"|| echo -e "\033[31m $i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done | ||
fi | ||
- name: 'Upload taosd logs' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: log-v3-taosd | ||
path: /var/log/taos/ | ||
retention-days: 2 | ||
|
||
- name: Check Test Result | ||
if: | ||
(steps.changed-files-specific.outputs.any_changed == 'true' | ||
&& github.event_name == 'pull_request') | ||
|| github.event_name == 'push' | ||
run: | | ||
if [ -f ~/taosbenchmark-release-failed.txt ];then | ||
cat ~/taosbenchmark-release-failed.txt | ||
exit 1 | ||
fi | ||
if [ -f ~/benchmark-ws-failed.txt ];then | ||
cat ~/benchmark-ws-failed.txt | ||
exit 1 | ||
fi |
Oops, something went wrong.