mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
246 lines
7.1 KiB
YAML
246 lines
7.1 KiB
YAML
name: TDengine Build
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- '3.0'
|
|
- '3.1'
|
|
- '3.3.6'
|
|
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'packaging/**'
|
|
- 'tests/**'
|
|
- '**/*.md'
|
|
- 'test/**'
|
|
- '.github/workflows/tdengine-docs-ci.yml'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Run on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-22.04
|
|
- ubuntu-24.04
|
|
- macos-14
|
|
- macos-15
|
|
- windows-2022
|
|
env:
|
|
TD_CONFIG: Release
|
|
|
|
steps:
|
|
- name: Get CPU Cores
|
|
shell: bash
|
|
run: |
|
|
if [ "${{ runner.os }}" == "Linux" ]; then
|
|
CPU_CORES=$(nproc)
|
|
elif [ "${{ runner.os }}" == "macOS" ]; then
|
|
CPU_CORES=$(sysctl -n hw.ncpu)
|
|
elif [ "${{ runner.os }}" == "Windows" ]; then
|
|
CPU_CORES=$(powershell -Command "(Get-CimInstance -ClassName Win32_Processor).NumberOfCores")
|
|
fi
|
|
echo "CPU Cores: $CPU_CORES"
|
|
echo "CPU_CORES=$CPU_CORES" >> $GITHUB_ENV
|
|
|
|
- name: Dump CPU Cores
|
|
run: |
|
|
echo "The number of CPU cores is: ${{ env.CPU_CORES }}"
|
|
|
|
- name: prepare install path
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
sudo mkdir -p /usr/local/lib
|
|
sudo mkdir -p /usr/local/include
|
|
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Cache Go modules on Linux and macOS
|
|
if: runner.os != 'Windows'
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Cache Homebrew on macOS
|
|
if: runner.os == 'macOS'
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: /usr/local/Homebrew
|
|
key: ${{ runner.os }}-brew-${{ hashFiles('**/Brewfile') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-brew-
|
|
|
|
- name: Cache Go modules on Windows
|
|
if: runner.os == 'Windows'
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
C:\Users\runneradmin\go\pkg\mod
|
|
C:\Users\runneradmin\AppData\Local\go-build
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.23
|
|
|
|
- name: Install dependencies on Linux
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt update -y
|
|
sudo apt install -y \
|
|
build-essential \
|
|
cmake \
|
|
gawk \
|
|
libgeos-dev \
|
|
libjansson-dev \
|
|
liblzma-dev \
|
|
libsnappy-dev \
|
|
libssl-dev \
|
|
libz-dev \
|
|
pkg-config \
|
|
zlib1g
|
|
|
|
- name: Install dependencies on macOS
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
brew update
|
|
brew install \
|
|
argp-standalone \
|
|
gawk \
|
|
gflags \
|
|
geos \
|
|
jansson \
|
|
openssl \
|
|
pkg-config \
|
|
snappy \
|
|
zlib
|
|
|
|
- name: Show software version
|
|
run: |
|
|
cmake --version
|
|
|
|
- name: Get CMake
|
|
uses: lukka/get-cmake@latest
|
|
with:
|
|
cmakeVersion: 3.31.6
|
|
|
|
- name: Install dependencies on Windows
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
choco install jom --yes
|
|
|
|
- name: Cache externals built
|
|
uses: actions/cache@v4
|
|
id: cache-ext
|
|
with:
|
|
path: ${{ github.workspace }}/.externals
|
|
key: ${{ runner.os }}-${{ matrix.os }}-${{ hashFiles('cmake/external.cmake', 'cmake/in/**') }}-debug-build-ext-v3 # this is tailing cache-version-tick
|
|
|
|
- if: ${{ steps.cache-ext.outputs.cache-hit != 'true' && runner.os != 'Windows' }}
|
|
name: Build externals on Linux and macOS
|
|
continue-on-error: false
|
|
run: |
|
|
./build.sh gen
|
|
./build.sh bld --target build_externals
|
|
|
|
- if: ${{ steps.cache-ext.outputs.cache-hit != 'true' && runner.os == 'Windows' }}
|
|
name: Build externals on Windows
|
|
continue-on-error: false
|
|
shell: cmd
|
|
run: |
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
|
|
set CL=/MP8
|
|
set TD_CONFIG=Release
|
|
call .\build.bat gen -G "NMake Makefiles JOM"
|
|
call .\build.bat bld --target build_externals
|
|
|
|
- name: Build TDengine on Linux and macOS
|
|
if: runner.os != 'Windows'
|
|
run: |
|
|
./build.sh gen -DTD_EXTERNALS_USE_ONLY:BOOL=ON
|
|
./build.sh bld
|
|
./build.sh install
|
|
which taosd
|
|
which taosadapter
|
|
which taoskeeper
|
|
which taos
|
|
taosd --help
|
|
taosadapter --help
|
|
|
|
- name: Build and install TDengine on Windows
|
|
if: runner.os == 'Windows'
|
|
shell: cmd
|
|
run: |
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
|
|
set CL=/MP8
|
|
set TD_CONFIG=Release
|
|
call .\build.bat gen -DTD_EXTERNALS_USE_ONLY:BOOL=ON -G "NMake Makefiles JOM"
|
|
call .\build.bat bld
|
|
call .\build.bat install
|
|
echo %PATH%
|
|
dir C:\TDengine
|
|
set PATH=%PATH%;C:\TDengine
|
|
echo %PATH%
|
|
where taos.exe
|
|
where taosd.exe
|
|
where taosadapter.exe
|
|
where taoskeeper.exe
|
|
taosd.exe --help
|
|
taosadapter.exe --help
|
|
|
|
- name: Statistics ldd
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
find ${{ github.workspace }}/debug/build/lib -type f -name "*.so" -print0 | xargs -0 ldd || true
|
|
find ${{ github.workspace }}/debug/build/bin -type f -print0 | xargs -0 ldd || true
|
|
|
|
- name: Statistics otool
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
find ${{ github.workspace }}/debug/build/lib -type f -name "*.dylib" -print0 | xargs -0 otool -L || true
|
|
find ${{ github.workspace }}/debug/build/bin -type f -print0 | xargs -0 otool -L || true
|
|
|
|
- name: Start taosd on Linux and macOS
|
|
if: runner.os != 'Windows'
|
|
run: |
|
|
taosd -V
|
|
taosadapter -V
|
|
taosBenchmark -V
|
|
taos -V
|
|
export TAOS_FQDN=localhost
|
|
nohup taosd &
|
|
nohup taosadapter &
|
|
pgrep -l taos
|
|
sleep 6 # NOTE: wait for taosd initialization to complete
|
|
pgrep -l taos
|
|
taos -s "show databases"
|
|
taos -s "show dnodes"
|
|
|
|
- name: Run tests with taosBenchmark
|
|
if: runner.os != 'Windows'
|
|
run: |
|
|
export TAOS_FQDN=localhost
|
|
taos -s "show databases"
|
|
taosBenchmark -t 10 -n 10 -s 1744951233012 -y
|
|
taos -s "select count(*) from test.meters"
|
|
|
|
- name: Clean up on Linux and macOS
|
|
if: runner.os != 'Windows'
|
|
run: |
|
|
./build.sh stop
|