You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2021/05/25 08:52:35 UTC
[iotdb] 01/01: Try to enable sonar for fork pr
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch try_sonar
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit de7fd0cad03d0cca8e5b21a0981c951ccad0a013
Author: HTHou <hh...@outlook.com>
AuthorDate: Tue May 25 16:51:38 2021 +0800
Try to enable sonar for fork pr
---
.github/workflows/client-go.yml | 54 ----------
.github/workflows/client.yml | 106 -------------------
.github/workflows/e2e.yml | 61 -----------
.github/workflows/main-win.yml | 112 ---------------------
...-unix.yml => run-tests-for-sonar-coveralls.yml} | 35 ++-----
.github/workflows/sonar-coveralls.yml | 26 +----
6 files changed, 16 insertions(+), 378 deletions(-)
diff --git a/.github/workflows/client-go.yml b/.github/workflows/client-go.yml
deleted file mode 100644
index 66f6e5e..0000000
--- a/.github/workflows/client-go.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-# This workflow is just for checking whether modifications works for the Go client.
-
-name: Go Client
-
-on:
- push:
- branches:
- - master
- - 'rel/*'
- paths-ignore:
- - 'docs/**'
- pull_request:
- branches:
- - master
- - 'rel/*'
- paths-ignore:
- - 'docs/**'
- # allow manually run the action:
- workflow_dispatch:
-
-env:
- MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
-
-jobs:
- unix:
- strategy:
- fail-fast: false
- max-parallel: 20
- matrix:
- java: [ 11 ]
- os: [ ubuntu-latest ]
- runs-on: ${{ matrix.os}}
-
- steps:
- - uses: actions/checkout@v2
- with:
- token: ${{secrets.GITHUB_TOKEN}}
- submodules: recursive
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v1
- with:
- java-version: ${{ matrix.java }}
- - name: Cache Maven packages
- uses: actions/cache@v2
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
- - name: Compile IoTDB Server
- run: mvn -B package -Dmaven.test.skip=true -am -pl server
- - name: Integration test
- shell: bash
- run: |
- cd client-go && make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo
\ No newline at end of file
diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml
deleted file mode 100644
index 21b37af..0000000
--- a/.github/workflows/client.yml
+++ /dev/null
@@ -1,106 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-# CPP compiling is too slow, so let's do it in parallel with testing other modules.
-# As there is no Java client, we just use one JDK.
-name: Clients_except_Java CI with Maven
-
-on:
- push:
- branches:
- - master
- - "rel/*"
- paths:
- - "client-*/**"
- - "compile-tools/**"
- - "thrift/**"
- - "service-rpc/**"
- pull_request:
- branches:
- - master
- - "rel/*"
- paths:
- - "client-*/**"
- - "compile-tools/**"
- - "thrift/**"
- - "service-rpc/**"
- # allow manually run the action:
- workflow_dispatch:
-
-env:
- MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
-
-jobs:
- build:
- strategy:
- fail-fast: false
- max-parallel: 20
- matrix:
- os: [ubuntu-latest, macos-latest]
- runs-on: ${{ matrix.os}}
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v1
- with:
- java-version: 11
- - name: Install CPP Dependencies (Ubuntu)
- if: matrix.os == 'ubuntu-latest'
- shell: bash
- run: sudo apt-get update && sudo apt-get install libboost-all-dev
- - name: Install CPP Dependencies (Mac)`
- if: matrix.os == 'macos-latest'
- shell: bash
- run: |
- brew install boost
- brew install bison
- echo 'export PATH=/usr/local/opt/bison/bin:$PATH' >> ~/.bash_profile
- source ~/.bash_profile && export LDFLAGS="-L/usr/local/opt/bison/lib"
- - name: Cache Maven packages
- uses: actions/cache@v2
- with:
- path: ~/.m2
- key: client-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
- - name: Test with Maven
- run: mvn -B clean integration-test -P compile-cpp -Dtsfile.test.skip=true -Djdbc.test.skip=true -Diotdb.test.skip=true -Dtest.port.closed=true -pl server,client-cpp,example/client-cpp-example -am
-
- build-win:
- strategy:
- fail-fast: false
- max-parallel: 20
- matrix:
- os: [windows-latest]
- runs-on: ${{ matrix.os}}
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v1
- with:
- java-version: 11
- - name: Cache Maven packages
- uses: actions/cache@v2
- with:
- path: ~/.m2
- key: client-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
- - name: Install Boost and Win_Flex_Bison
- run: mkdir D:\a\cpp ; `
- Invoke-WebRequest https://github.com/lexxmark/winflexbison/releases/download/v2.5.24/win_flex_bison-2.5.24.zip -OutFile D:\a\cpp\win_flex_bison.zip ; `
- [Environment]::SetEnvironmentVariable("Path", $env:Path + ";D:\a\cpp", "User") ; `
- Invoke-WebRequest https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.zip -OutFile D:\a\cpp\boost_1_72_0.zip ; `
- Expand-Archive D:\a\cpp\boost_1_72_0.zip -DestinationPath D:\a\cpp ; `
- cd D:\a\cpp\boost_1_72_0 ; `
- .\bootstrap.bat ; `
- .\b2.exe
- - name: Install OpenSSL
- run: Invoke-WebRequest https://slproweb.com/download/Win64OpenSSL-1_1_1k.exe -OutFile D:\a\cpp ; `
- [Environment]::SetEnvironmentVariable("Path", $env:Path + ";D:\a\cpp", "User") ; `
- - name: Add Flex and Bison Path and OpenSSL
- shell: bash
- run: cd /d/a/cpp && unzip win_flex_bison.zip && mv win_flex.exe flex.exe && mv win_bison.exe bison.exe && mv Win64OpenSSL-1_1_1k.exe openssl.exe && echo 'export PATH=/d/a/cpp:$PATH' >> ~/.bash_profile && source ~/.bash_profile
- - name: Test with Maven
- shell: bash
- run: source ~/.bash_profile && mvn -B clean integration-test -P compile-cpp -Dboost.include.dir=/d/a/cpp/boost_1_72_0 -Dboost.library.dir=/d/a/cpp/boost_1_72_0/stage/lib -Dtsfile.test.skip=true -Djdbc.test.skip=true -Diotdb.test.skip=true -Dtest.port.closed=true -Denforcer.skip=true -pl server,client-cpp,example/client-cpp-example -am
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
deleted file mode 100644
index d0c2c60..0000000
--- a/.github/workflows/e2e.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: E2E Tests
-
-on:
- push:
- branches:
- - master
- - 'rel/*'
- - test/e2e
- paths-ignore:
- - 'docs/**'
- pull_request:
- branches:
- - master
- - 'rel/*'
- - cluster_new
- paths-ignore:
- - 'docs/**'
- # allow manually run the action:
- workflow_dispatch:
-
-env:
- MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
-
-jobs:
- E2E:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: true
- matrix:
- case:
- - cli
- steps:
- - uses: actions/checkout@v2
-
- - uses: actions/cache@v2
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2
-
- - name: Build Distribution Zip
- run: ./mvnw.sh -B -DskipTests clean install
-
- - name: Build Docker Image
- run: |
- docker build . -f docker/src/main/Dockerfile-single -t "iotdb:$GITHUB_SHA"
- docker images
-
- - name: Run Test Case ${{ matrix.case }}
- run: bash test/e2e/cases/${{ matrix.case }}/run.sh
-
- - name: Clean Up
- if: ${{ always() }}
- run: bash test/e2e/cases/${{ matrix.case }}/cleanup.sh
-
- - name: TestContainer
- run: |
- mvn -B integration-test -pl testcontainer
diff --git a/.github/workflows/main-win.yml b/.github/workflows/main-win.yml
deleted file mode 100644
index 9ea7a61..0000000
--- a/.github/workflows/main-win.yml
+++ /dev/null
@@ -1,112 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Main Win
-
-on:
- push:
- branches:
- - master
- - 'rel/*'
- paths-ignore:
- - 'docs/**'
- pull_request:
- branches:
- - master
- - 'rel/*'
- - cluster_new
- paths-ignore:
- - 'docs/**'
- # allow manually run the action:
- workflow_dispatch:
-
-env:
- MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
-
-jobs:
- win:
- strategy:
- fail-fast: false
- max-parallel: 20
- matrix:
- java: [8, 11, 16]
- # to reduce the CI time cost; we split the whole CI to 3 parts:
- # modules except the server and the cluster:
- # -Diotdb.skip.test=true -Dcluster.skip.test=true
- # the server module:
- # -pl server -am -DskipTests=true -Diotdb.test.only=true
- # the cluster module:
- # -pl cluster -am -DskipTests=true -Dcluster.test.only=true
- # but we just add labels here to make the action name more graceful
- it_task: ['others',
- 'server',
- 'cluster'
- ]
- runs-on: windows-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v1
- with:
- java-version: ${{ matrix.java }}
- - name: Cache Maven packages
- uses: actions/cache@v2
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
- - name: Check Apache Rat
- run: mvn -B apache-rat:check
- - name: Download Hadoop Tools if Needed
- # Using Powershell ...
- # github action put codes to d:\a
- run: mkdir D:\a\hadoop\bin ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/winutils.exe -OutFile D:\a\hadoop\bin\winutils.exe ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.dll -OutFile C:\windows\system32\hadoop.dll ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop -OutFile D:\a\hadoop\bin\hadoop ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.cmd -OutFile D:\a\hadoop\bin\hadoop.cmd ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.exp -OutFile D:\a\hadoop\bin\hadoop.exp ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.lib -OutFile D:\a\hadoop\bin\hadoop.lib ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hadoop.pdb -OutFile D:\a\hadoop\bin\hadoop.pdb ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.dll -OutFile C:\windows\system32\hdfs.dll ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs -OutFile D:\a\hadoop\bin\hdfs ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.cmd -OutFile D:\a\hadoop\bin\hdfs.cmd ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.exp -OutFile D:\a\hadoop\bin\hdfs.exp ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.lib -OutFile D:\a\hadoop\bin\hdfs.lib ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs.pdb -OutFile D:\a\hadoop\bin\hdfs.pdb ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/hdfs_static.lib -OutFile D:\a\hadoop\bin\hdfs_static.lib ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/libwinutils.lib -OutFile D:\a\hadoop\bin\libwinutils.lib ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/mapred -OutFile D:\a\hadoop\bin\mapred ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/mapred.cmd -OutFile D:\a\hadoop\bin\mapred.cmd ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/rcc -OutFile D:\a\hadoop\bin\rcc ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/winutils.pdb -OutFile D:\a\hadoop\bin\winutils.pdb ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/yarn -OutFile D:\a\hadoop\bin\yarn ; `
- Invoke-WebRequest https://github.com/cdarlint/winutils/raw/master/hadoop-2.7.3/bin/yarn.cmd -OutFile D:\a\hadoop\bin\yarn.cmd ; `
- [Environment]::SetEnvironmentVariable("Path", $env:Path + ";D:\a\hadoop\bin", "User") ; `
- [Environment]::SetEnvironmentVariable("HADOOP_HOME", "D:\a\hadoop", "User")
- - name: Add Hadoop Path (Win)
- shell: bash
- run: echo 'export PATH=/d/a/hadoop/bin:$PATH' >> ~/.bash_profile && echo 'export HADOOP_HOME=/d/a/hadoop' >> ~/.bash_profile && source ~/.bash_profile
- - name: Check Hadoop Path (Win)
- shell: bash
- run: source ~/.bash_profile && echo $PATH
- - name: Cache Hadoop packages (Win)
- uses: actions/cache@v2
- with:
- path: D:\a\hadoop
- key: ${{ runner.os }}-hadoop-files${{ hashFiles('**/*.exe') }}
- restore-keys: ${{ runner.os }}-hadoop-files
- - name: Test Server Module with Maven
- shell: bash
- if: ${{ matrix.it_task == 'server'}}
- run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true -pl server -am -DskipTests=true -Diotdb.test.only=true
- - name: Test Cluster Module with Maven
- shell: bash
- if: ${{ matrix.it_task == 'cluster'}}
- run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true -pl cluster -am -DskipTests=true -Dcluster.test.only=true
- - name: Test Other Modules with Maven
- shell: bash
- if: ${{ matrix.it_task == 'others'}}
- run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true -Diotdb.test.skip=true -Dcluster.test.skip=true
-
diff --git a/.github/workflows/main-unix.yml b/.github/workflows/run-tests-for-sonar-coveralls.yml
similarity index 57%
rename from .github/workflows/main-unix.yml
rename to .github/workflows/run-tests-for-sonar-coveralls.yml
index f94f053..a821afa 100644
--- a/.github/workflows/main-unix.yml
+++ b/.github/workflows/run-tests-for-sonar-coveralls.yml
@@ -1,55 +1,42 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-name: Main Mac and Linux
+name: Run Tests for Sonar-Coveralls
on:
push:
branches:
- master
- - 'rel/*'
- - Vector
+ - "rel/*"
paths-ignore:
- - 'docs/**'
+ - "docs/**"
pull_request:
branches:
- master
- - 'rel/*'
+ - "rel/*"
- cluster_new
- - Vector
paths-ignore:
- - 'docs/**'
- # allow manually run the action:
- workflow_dispatch:
+ - "docs/**"
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
jobs:
- unix:
- strategy:
- fail-fast: false
- max-parallel: 20
- matrix:
- java: [ 8, 11, 16 ]
- os: [ ubuntu-latest, macos-latest ]
- runs-on: ${{ matrix.os}}
+ ubuntu:
+ runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Set up JDK ${{ matrix.java }}
+ - name: Set up JDK 11
uses: actions/setup-java@v1
with:
- java-version: ${{ matrix.java }}
+ java-version: 11
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- - name: Check Apache Rat
- run: mvn -B apache-rat:check -P site -P code-coverage
- - name: IT/UT Test
- shell: bash
+ #- name: IT/UT Test
# we do not compile client-cpp for saving time, it is tested in client.yml
- run: mvn -B clean post-integration-test -Dtest.port.closed=true
+ # run: mvn -B clean post-integration-test -Dtest.port.closed=true -Pcode-coverage
diff --git a/.github/workflows/sonar-coveralls.yml b/.github/workflows/sonar-coveralls.yml
index 7f1dcdc..36e1242 100644
--- a/.github/workflows/sonar-coveralls.yml
+++ b/.github/workflows/sonar-coveralls.yml
@@ -1,24 +1,13 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-name: Sonar-Coveralls(Ignore this on folk Repos)
+name: Sonar-Coveralls
on:
- push:
- branches:
- - master
- - "rel/*"
- paths-ignore:
- - "docs/**"
- pull_request:
- branches:
- - master
- - "rel/*"
- - cluster_new
- paths-ignore:
- - "docs/**"
- # allow manually run the action:
- workflow_dispatch:
+ workflow_run:
+ workflows: ["Run Tests for Sonar-Coveralls"]
+ types:
+ - completed
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
@@ -39,11 +28,7 @@ jobs:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- - name: IT/UT Test
- # we do not compile client-cpp for saving time, it is tested in client.yml
- run: mvn -B clean post-integration-test -Dtest.port.closed=true -Pcode-coverage
- name: Code Coverage (Coveralls)
- if: ${{ success() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'apache/iotdb' || github.event_name == 'push') }}
run: |
mvn -B post-integration-test -Pcode-coverage -pl code-coverage
mvn -B coveralls:report \
@@ -53,7 +38,6 @@ jobs:
-DrepoToken=${{ secrets.COVERALL_TOKEN }} \
-Pcode-coverage
- name: SonarCloud Report
- if: ${{ success() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'apache/iotdb' || github.event_name == 'push') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}