This is an automated email from the ASF dual-hosted git repository.
ayushtkn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new 744271738e2 HIVE-30046: Move Thrift gen code validation in GitHub
actions (#6832)
744271738e2 is described below
commit 744271738e2d89f94156c41bc307efaa57a06b7e
Author: Ayush Saxena <[email protected]>
AuthorDate: Fri Oct 2 00:23:34 2026 +0530
HIVE-30046: Move Thrift gen code validation in GitHub actions (#6832)
---
.github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++++++++++--
Jenkinsfile | 16 +---------------
2 files changed, 45 insertions(+), 17 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d354ace727a..334ea6d61b0 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -45,8 +45,50 @@ jobs:
java-version: '21'
distribution: 'temurin'
cache: maven
+ - name: Cache Thrift 0.16.0
+ if: runner.os == 'Linux'
+ id: cache-thrift
+ uses: actions/cache@v4
+ with:
+ path: ${{ github.workspace }}/thrift-0.16.0-install
+ key: thrift-0.16.0-${{ runner.os }}-${{ runner.arch }}
+ - name: Install Thrift 0.16.0
+ if: runner.os == 'Linux' && steps.cache-thrift.outputs.cache-hit !=
'true'
+ run: |
+ sudo apt-get update && sudo apt-get install -y bison flex g++
libboost-all-dev libevent-dev libssl-dev make pkg-config
+ curl -fSL --retry 3 --retry-delay 5 -o thrift-0.16.0.tar.gz
https://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz
+ tar xzf thrift-0.16.0.tar.gz
+ cd thrift-0.16.0
+ ./configure --prefix=${{ github.workspace }}/thrift-0.16.0-install \
+ --without-java --without-python --without-py3 --without-ruby \
+ --without-nodejs --without-go --without-erlang --without-lua \
+ --without-perl --without-php --without-php_extension
--without-dart \
+ --without-dotnetcore --without-swift --without-rs \
+ --without-cl --without-haskell --without-d \
+ --without-cpp --without-c_glib --without-netstd
+ make -j$(nproc)
+ make install
+ mkdir -p ${{ github.workspace }}/thrift-0.16.0-install/share/fb303/if
+ cp contrib/fb303/if/fb303.thrift ${{ github.workspace
}}/thrift-0.16.0-install/share/fb303/if/
+ cd ..
+ rm -rf thrift-0.16.0 thrift-0.16.0.tar.gz
- name: Build with Maven
- run: >
- mvn clean install -DskipTests -Pitests
+ run: |
+ PROFILES="-Pitests"
+ if [[ "$RUNNER_OS" == "Linux" ]]; then
+ PROFILES+=",thriftif -Dthrift.home=${{ github.workspace
}}/thrift-0.16.0-install"
+ fi
+ mvn clean install -DskipTests $PROFILES
+ - name: Thrift validation
+ if: runner.os == 'Linux'
+ run: |
+ n=$(git status -s -- '*/src/gen/thrift/*' | wc -l)
+ if [ "$n" != 0 ]; then
+ echo "ERROR: Thrift generated code is out of date!" >&2
+ echo "The following files differ:" >&2
+ git diff --stat -- '*/src/gen/thrift/*' >&2
+ exit 1
+ fi
+ echo "Thrift generated code is up to date."
- name: 'Dependency tree'
run: mvn dependency:tree -Pitests
diff --git a/Jenkinsfile b/Jenkinsfile
index 759477a7082..c2da8e93e9a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -97,9 +97,8 @@ sw java 21 && . /etc/profile.d/java.sh
mkdir -p .m2/repository
cp $SETTINGS .m2/settings.xml
OPTS=" -s $PWD/.m2/settings.xml -B -Dtest.groups= "
-OPTS+=" -Pitests,qsplits,dist,errorProne,thriftif"
+OPTS+=" -Pitests,qsplits,dist,errorProne"
OPTS+=" -Dmaven.repo.local=$PWD/.m2/repository"
-OPTS+=" -Dthrift.home=/work/thrift-0.16.0"
git config extra.mavenOpts "$OPTS"
OPTS=" $M_OPTS -Dmaven.test.failure.ignore "
if [ -s inclusions.txt ]; then OPTS+="
-Dsurefire.includesFile=$PWD/inclusions.txt";fi
@@ -286,19 +285,6 @@ fi
stage('Compile') {
buildHive("install -Dtest=noMatches")
}
- stage('Thrift validation') {
- sh '''#!/bin/bash -e
-set -x
-n=$(git status -s -- '*/src/gen/thrift/*' | wc -l)
-if [ $n != 0 ]; then
- echo "ERROR: Thrift generated code is out of date!" >&2
- echo "The following files differ:" >&2
- git diff --stat -- '*/src/gen/thrift/*' >&2
- exit 1
-fi
-echo "Thrift generated code is up to date."
-'''
- }
checkPrHead()
stage('Upload') {
saveWS()