Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] fix Code Quality Analysis failed #9685

Merged
merged 2 commits into from
May 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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