blob: e26a566b2f20919933cf33eb3303418cb49fc492 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Compatibility-Test
on:
push:
branches:
- develop
- iotdb
- rc/*
pull_request:
branches:
- develop
- dev/*
- iotdb
- rc/*
workflow_dispatch:
inputs:
forceUpdates:
description: "Forces a snapshot update"
required: false
default: 'false'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
jobs:
generate-fixtures:
name: Generate ${{ matrix.language }} fixtures
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ java, cpp ]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Install C++ dependencies
if: matrix.language == 'cpp'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y uuid-dev
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100
sudo update-alternatives --set clang-format /usr/bin/clang-format-17
- name: Generate Java table fixtures
if: matrix.language == 'java'
shell: bash
run: |
mkdir -p compat-fixtures/java
./mvnw -P with-java \
-Dtest=TableModelEncodingCompressionCompatibilityTest#generateFixtures \
-Dsurefire.failIfNoSpecifiedTests=false \
-Dtsfile.compat.generate.dir="$PWD/compat-fixtures/java" \
test
- name: Build C++ tests
if: matrix.language == 'cpp'
shell: bash
run: |
./mvnw -P with-cpp -Dbuild.type=Release -DskipTests package
- name: Generate C++ table fixtures
if: matrix.language == 'cpp'
shell: bash
run: |
mkdir -p compat-fixtures/cpp
TSFILE_COMPAT_GENERATE_DIR="$PWD/compat-fixtures/cpp" \
./cpp/target/build/test/lib/TsFile_Test \
--gtest_filter=TableModelEncodingCompressionCompatibilityTest.GenerateFixtures
- name: Upload ${{ matrix.language }} fixtures
uses: actions/upload-artifact@v7
with:
name: tsfile-${{ matrix.language }}-compat-fixtures
path: compat-fixtures/${{ matrix.language }}/
retention-days: 1
validate-fixtures:
name: Validate ${{ matrix.writer }} fixtures with ${{ matrix.reader }}
needs: generate-fixtures
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- writer: java
reader: cpp
- writer: cpp
reader: java
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: corretto
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v5
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Install C++ dependencies
if: matrix.reader == 'cpp'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y uuid-dev
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100
sudo update-alternatives --set clang-format /usr/bin/clang-format-17
- name: Download ${{ matrix.writer }} fixtures
uses: actions/download-artifact@v8
with:
name: tsfile-${{ matrix.writer }}-compat-fixtures
path: compat-fixtures/${{ matrix.writer }}
- name: Validate ${{ matrix.writer }} fixtures with Java
if: matrix.reader == 'java'
shell: bash
run: |
./mvnw -P with-java \
-Dtest=TableModelEncodingCompressionCompatibilityTest#validateFixtures \
-Dsurefire.failIfNoSpecifiedTests=false \
-Dtsfile.compat.validate.dir="$PWD/compat-fixtures/${{ matrix.writer }}" \
test
- name: Build C++ tests
if: matrix.reader == 'cpp'
shell: bash
run: |
./mvnw -P with-cpp -Dbuild.type=Release -DskipTests package
- name: Validate ${{ matrix.writer }} fixtures with C++
if: matrix.reader == 'cpp'
shell: bash
run: |
TSFILE_COMPAT_VALIDATE_DIR="$PWD/compat-fixtures/${{ matrix.writer }}" \
./cpp/target/build/test/lib/TsFile_Test \
--gtest_filter=TableModelEncodingCompressionCompatibilityTest.ValidateFixtures