You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by pi...@apache.org on 2021/08/15 14:45:52 UTC

[submarine] branch master updated: SUBMARINE-977. Fix sonarcloud workflow run error

This is an automated email from the ASF dual-hosted git repository.

pingsutw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new b2b3a6e  SUBMARINE-977. Fix sonarcloud workflow run error
b2b3a6e is described below

commit b2b3a6e22a6f185b88a092f2cdb0773108af14c4
Author: Kevin Su <pi...@apache.org>
AuthorDate: Sun Aug 15 22:32:02 2021 +0800

    SUBMARINE-977. Fix sonarcloud workflow run error
    
    ### What is this PR for?
    <!-- A few sentences describing the overall goals of the pull request's commits.
    First time? Check out the contributing guide - https://submarine.apache.org/contribution/contributions.html
    -->
    https://github.com/apache/submarine/runs/3329896724
    sonar-maven-plugin only supports JDK 11, so exclude the module that can not be compiled with JDK 11
    
    1. Build the project with jdk8
    2. Change to jdk11
    3. Run `mvn verify -DskipTests org.sonarsource.scanner.maven:sonar-maven-plugin:sonar` with JDK 11 to upload result to sonarcloud
    
    ### What type of PR is it?
    [Bug Fix ]
    
    ### Todos
    No
    
    ### What is the Jira issue?
    <!-- * Open an issue on Jira https://issues.apache.org/jira/browse/SUBMARINE/
    * Put link here, and add [SUBMARINE-*Jira number*] in PR title, eg. `SUBMARINE-23. PR title`
    -->
    https://issues.apache.org/jira/browse/SUBMARINE-977
    
    ### How should this be tested?
    <!--
    * First time? Setup Travis CI as described on https://submarine.apache.org/contribution/contributions.html#continuous-integration
    * Strongly recommended: add automated unit tests for any new or changed behavior
    * Outline any manual steps to test the PR here.
    -->
    Pass the CIs, and I successfully upload the result to my sonarcloud
    https://sonarcloud.io/dashboard?id=pingsutw_hadoop-submarine
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: Kevin Su <pi...@apache.org>
    
    Signed-off-by: Kevin <pi...@apache.org>
    
    Closes #711 from pingsutw/SUBMARINE-977 and squashes the following commits:
    
    d4f24035 [Kevin Su] Update sonarcloud.yml
---
 .github/workflows/sonarcloud.yml | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index ef9b5fc..04b1c9e 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -18,8 +18,7 @@ on:
   push:
     branches:
       - master
-  pull_request:
-    types: [opened, synchronize, reopened]
+
 jobs:
   sonarcloud:
     if: github.repository == 'apache/submarine'
@@ -29,11 +28,35 @@ jobs:
       - uses: actions/checkout@v2
         with:
           fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: print secret
-        run: echo "${{ secrets.SONARCLOUD_TOKEN }}" && echo "${{ secrets.SONAR_TOKEN }}"
-      - name: SonarCloud Scan
-        uses: SonarSource/sonarcloud-github-action@master
+      - name: Cache Maven packages
+        uses: actions/cache@v1
+        with:
+          path: ~/.m2
+          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-m2
+      - name: Cache SonarCloud packages
+        uses: actions/cache@v1
+        with:
+          path: ~/.sonar/cache
+          key: ${{ runner.os }}-sonar
+          restore-keys: ${{ runner.os }}-sonar
+      - name: Set up JDK 1.8
+        uses: actions/setup-java@v1
+        with:
+          java-version: "1.8"
+      - name: Set up Maven 3.6.3
+        uses: stCarolas/setup-maven@v4
+        with:
+          maven-version: 3.6.3
+      - name: Build the project with JDK 8
+        run: mvn clean install -DskipTests
+      - name: Set up JDK 11
+        uses: actions/setup-java@v1
+        with:
+          java-version: 11
+      - name: Build and analyze with JDK 11 # sonar-maven-plugin only support JDK 11
+        run: mvn verify -DskipTests org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -pl $EXCLUDE_MODULE -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_submarine
         env:
           SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-          
+          EXCLUDE_MODULE: '!:submarine-commons-rpc,!:submarine-spark-security' # Exclude the modules that can't be compiled with JDK 11

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org