Skip to content

Commit

Permalink
[fix] fix Code Quality Analysis failed (apache#9685)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzhg authored and minghong.zhou committed May 23, 2022
1 parent eb862ba commit bd7a97e
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
pull_request_target:

jobs:
build:
name: Build
Expand All @@ -32,36 +32,51 @@ jobs:
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Changed Java Files
id: java-changes
uses: tj-actions/changed-files@a59f800cbb60ed483623848e31be67659a2940f8
with:
sha: "${{ github.pull_request.sha }}"
base_sha: "${{ github.sha }}"
files: |
**/*.java
**/*.xml
- name: Set up JDK 11
uses: actions/setup-java@v1
uses: actions/setup-java@v3
if: steps.java-changes.outputs.any_changed == 'true'
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Setup thrift
if: steps.java-changes.outputs.any_changed == 'true'
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y thrift-compiler=0.13.0-2build2
thrift --version
mkdir -p thirdparty/installed/bin/
cd thirdparty/installed/bin/ && ln -s /usr/bin/thrift thrift
- name: Analyze FE
if: steps.java-changes.outputs.any_changed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
cd fe
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_incubator-doris -DskipTests
Expand Down

0 comments on commit bd7a97e

Please sign in to comment.