From cc000b4a0a190066e19b30f408115ae820a6e9ae Mon Sep 17 00:00:00 2001
From: shiyuhang0 <52435083+shiyuhang0@users.noreply.github.com>
Date: Wed, 29 Dec 2021 21:35:32 -0600
Subject: [PATCH] CI config (#2188)
* ADD:add verify.yml in workflow contains fmt,build and ut
* ADD:add excludes in maven-surefire-plugin so that the integration test can be excluded with command line
* ADD:add sonatype config
* MOD:increase instanceCap and reduce resourceRequest in integration_test to improve parallelism
* MOD:remove test PartitionTableSuite for takes too much time
* MOD:mod mvn-scalafmt plugin's annotation
* Revert "MOD:mod mvn-scalafmt plugin's annotation"
This reverts commit 2ecb400e9fd6c554c9c37aaa08f026ec7be3fa1a.
* MOD:add integration_test's namespace and remove idleMinutes
* trigger GitHub actions
* Revert "MOD:add integration_test's namespace and remove idleMinutes"
This reverts commit 1353b3f59cc06994a81ede52311deb4d6dbe8f6e.
* MOD:add integration_test's namespace and remove idleMinutes
* trigger github action
* MOD:mod veridy.yml,check if support ipv6
---
.ci/integration_test.groovy | 8 ++---
.github/workflows/verify.yml | 69 ++++++++++++++++++++++++++++++++++++
.lift.toml | 14 ++++++++
pom.xml | 4 +++
4 files changed, 91 insertions(+), 4 deletions(-)
create mode 100644 .github/workflows/verify.yml
create mode 100644 .lift.toml
diff --git a/.ci/integration_test.groovy b/.ci/integration_test.groovy
index 78840c79c2..b65050d90b 100644
--- a/.ci/integration_test.groovy
+++ b/.ci/integration_test.groovy
@@ -110,14 +110,14 @@ def call(ghprbActualCommit, ghprbCommentBody, ghprbPullId, ghprbPullTitle, ghprb
def label = "regression-test-tispark"
- podTemplate(name: label, label: label, instanceCap: 10, idleMinutes: 10, containers: [
+ podTemplate(name: label, label: label, instanceCap: 20, namespace: 'jenkins-tispark' , containers: [
containerTemplate(name: 'golang', image: 'hub.pingcap.net/jenkins/centos7_golang-1.12:cached',
envVars: [
envVar(key: 'DOCKER_HOST', value: 'tcp://localhost:2375'),
], alwaysPullImage: true, ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'java', image: 'hub.pingcap.net/jenkins/centos7_golang-1.13_java:cached',
- resourceRequestCpu: '8000m',
- resourceRequestMemory: '16Gi',
+ resourceRequestCpu: '4000m',
+ resourceRequestMemory: '8Gi',
envVars: [
envVar(key: 'DOCKER_HOST', value: 'tcp://localhost:2375'),
], alwaysPullImage: true, ttyEnabled: true, command: 'cat'),
@@ -177,7 +177,7 @@ def call(ghprbActualCommit, ghprbCommentBody, ghprbPullId, ghprbPullTitle, ghprb
pwd
cp -R /home/jenkins/agent/git/tispark/. ./
git checkout -f ${ghprbActualCommit}
- find core/src -name '*Suite*' | grep -v 'MultiColumnPKDataTypeSuite' > test
+ find core/src -name '*Suite*' | grep -v 'MultiColumnPKDataTypeSuite\\|PartitionTableSuite' > test
shuf test -o test2
mv test2 test
"""
diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml
new file mode 100644
index 0000000000..b936d0ba1e
--- /dev/null
+++ b/.github/workflows/verify.yml
@@ -0,0 +1,69 @@
+# this workflow contains fmt,build,ut fot tikv-client
+name: verify
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ fmt:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - name: Set up JDK
+ uses: actions/setup-java@v2
+ with:
+ java-version: '8'
+ distribution: 'adopt'
+ cache: maven
+ - name: fmt
+ run: |
+ export LC_ALL=en_US.UTF-8
+ export LANG=en_US.UTF-8
+ export LANGUAGE=en_US.UTF-8
+ mvn mvn-scalafmt_2.12:format -Dscalafmt.skip=false -B
+ mvn com.coveo:fmt-maven-plugin:format -B
+ git diff --quiet
+ formatted="$?"
+ if [[ "${formatted}" -eq 1 ]]
+ then
+ echo "code format error, please run the following commands:"
+ echo " mvn mvn-scalafmt_2.12:format -Dscalafmt.skip=false"
+ echo " mvn com.coveo:fmt-maven-plugin:format"
+ exit 1
+ fi
+
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Set up JDK
+ uses: actions/setup-java@v2
+ with:
+ java-version: '8'
+ distribution: 'adopt'
+ cache: maven
+ - name: build
+ run: |
+ mvn clean package -Dmaven.test.skip=true -B
+
+ tikv-client-ut:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v2
+ - name: Set up JDK
+ uses: actions/setup-java@v2
+ with:
+ java-version: '8'
+ distribution: 'adopt'
+ cache: maven
+ - name: ut
+ run: |
+ lsmod | grep -qw ipv6 && mvn test -am -pl tikv-client -DsomeModule.test.excludes="**/txn/*" -B || mvn test -am -pl tikv-client -DsomeModule.test.excludes="**/txn/*,**/PDClientTest.java" -B
\ No newline at end of file
diff --git a/.lift.toml b/.lift.toml
new file mode 100644
index 0000000000..fe9a1e09ce
--- /dev/null
+++ b/.lift.toml
@@ -0,0 +1,14 @@
+build = "mvn"
+
+ignoreFiles = """
+assembly/**
+db-random-test/**
+spark-wrapper/**
+tikv-client/target/**
+core/target/**
+**/build/**
+"""
+
+tools = [ "infer", "findsecbugs","errorprone" ]
+
+jdk11 = false
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 46fd9948e7..2a6a75fc31 100644
--- a/pom.xml
+++ b/pom.xml
@@ -88,6 +88,7 @@
2.3.0
+
@@ -209,6 +210,9 @@
suites
true
always
+
+ ${someModule.test.excludes}
+
3.0.0-M3