This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new ce0f62404d4 Add : add sonarcloud analyze for pull request (#25539)
ce0f62404d4 is described below
commit ce0f62404d41ceb81fe0cd6a253f47ad8a2407a9
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Tue May 9 22:41:00 2023 +0800
Add : add sonarcloud analyze for pull request (#25539)
* Add : add sonarcloud analyze for pull request
* Refactor : refactor to github action way
* Refactor : refactor the naming
* Refactor : refactor the naming
* Refactor : refactor the trigger conidtion
* Refacor : remove the useless name properties
---------
Co-authored-by: shardingsphere <[email protected]>
---
.github/workflows/check-sonarcloud.yml | 65 ++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/.github/workflows/check-sonarcloud.yml
b/.github/workflows/check-sonarcloud.yml
new file mode 100644
index 00000000000..3ed48f8b4e8
--- /dev/null
+++ b/.github/workflows/check-sonarcloud.yml
@@ -0,0 +1,65 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+name: Check - SonarCloud
+
+on:
+ pull_request:
+ branches: [ master ]
+ paths:
+ - '**/src/main/**'
+ - '**/src/test/**'
+ - 'src/resources/**'
+ - 'examples/shardingsphere-example-generator/**'
+ - '!examples/**'
+ - '!*.md'
+ workflow_dispatch:
+
+concurrency:
+ group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+env:
+ CACHE_PREFIX: shardingsphere
+
+jobs:
+ build:
+ name: Analyze to SonarCloud
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-java@v3
+ with:
+ distribution: 'temurin'
+ java-version: 11
+ - uses: actions/cache@v3
+ with:
+ path: ~/.sonar/cache
+ key: ${{ runner.os }}-sonar
+ restore-keys: ${{ runner.os }}-sonar
+ - uses: actions/cache@v3
+ with:
+ path: ~/.m2/repository
+ key: ${{ env.CACHE_PREFIX }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ restore-keys: |
+ ${{ env.CACHE_PREFIX }}-maven-third-party-
+ - uses: SonarSource/SonarCloud-github-action@master
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}