Skip to content

chore: add test to get jvm and adapter taosc timezone #126

chore: add test to get jvm and adapter taosc timezone

chore: add test to get jvm and adapter taosc timezone #126

Workflow file for this run

name: build
on:
push:
branches:
- main
- '3.0'
paths-ignore:
- 'LICENSE'
- '*.md'
- '*.txt'
pull_request:
branches:
- main
- '3.0'
paths-ignore:
- 'LICENSE'
- '*.md'
- '*.txt'
jobs:
build:
strategy:
matrix:
# os: [ ubuntu-latest,macos-latest,windows-latest ]
os: [ Ubuntu-22.04 ]
java: [ 8 ]
maven: [ '3.6.3' ]
runs-on: ${{ matrix.os }}
steps:
# 设置系统级时区为 UTC
- name: Set system timezone to UTC
run: |
sudo timedatectl set-timezone UTC
echo "Current system timezone: $(timedatectl | grep "Time zone")"
- name: checkout TDengine
uses: actions/checkout@v3
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: ${{ github.base_ref }}
- name: prepare install
run: |
sudo apt-get install -y libgeos-dev
geos-config --version
- name: install TDengine
run: cd TDengine && mkdir debug && cd debug && cmake .. -DBUILD_JDBC=false -DBUILD_TOOLS=false -DBUILD_HTTP=false -DBUILD_DEPENDENCY_TESTS=false && make && sudo make install
- name: shell
run: |
cat >start.sh<<EOF
ulimit -n 65535 && TAOS_SUPPORT_VNODES=256 taosd
EOF
- name: taosd
run: nohup sudo sh ./start.sh &
- name: start taosadapter
run: sudo taosadapter &
- name: checkout
uses: actions/checkout@v4
with:
path: 'jdbc-workspace'
- name: set up java
uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: ${{ matrix.java }}
java-package: jdk
# 设置 JVM 时区为 UTC
- name: Test
working-directory: jdbc-workspace
env:
TDENGINE_CLOUD_URL: ${{ secrets.TDENGINE_CLOUD_URL }}
# 设置 JVM 时区参数
MAVEN_OPTS: "-Duser.timezone=UTC"
run: |
# 验证系统时区
echo "System timezone: $(date +'%Z %z')"
# 验证 Java 时区
java -XshowSettings:properties -version 2>&1 | grep user.timezone
# 运行测试
mvn -B clean verify --file pom.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: jdbc-workspace/target/site/jacoco/jacoco.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true