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

zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new e0330433 [CI]Add Sonar Check (#1656)
e0330433 is described below

commit e03304336b51908fe94cc0c5c60b22f23b72f8db
Author: Kirs <[email protected]>
AuthorDate: Mon Apr 11 19:52:57 2022 +0800

    [CI]Add Sonar Check (#1656)
    
    * [CI]Add Sonar Check
    It can help us better check some possible problems with the project
---
 .github/workflows/code-analysys.yml | 40 +++++++++++++++++++++++++++++++++++++
 tools/sonarcheck/check.sh           | 21 +++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/.github/workflows/code-analysys.yml 
b/.github/workflows/code-analysys.yml
new file mode 100644
index 00000000..0211b560
--- /dev/null
+++ b/.github/workflows/code-analysys.yml
@@ -0,0 +1,40 @@
+# 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: SonarCloud
+on:
+  push:
+  pull_request:
+    branches: [dev]
+    paths-ignore:
+      - 'docs/**'
+      - '**/*.md'
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Set up JDK 11
+        uses: actions/setup-java@v2
+        with:
+          java-version: 11
+          distribution: 'adopt'
+      - name: Run SonarCloud Analysis
+        run: bash ./tools/sonarcheck/check.sh          
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
\ No newline at end of file
diff --git a/tools/sonarcheck/check.sh b/tools/sonarcheck/check.sh
new file mode 100644
index 00000000..dc098d5b
--- /dev/null
+++ b/tools/sonarcheck/check.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# 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.
+
+if [ ! "$SONAR_TOKEN" ]; then
+  echo "SONAR_TOKEN environment is null, skip check"
+  exit 0
+fi
+./mvnw --batch-mode verify sonar:sonar -Dmaven.test.skip=true 
-Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache 
-Dsonar.projectKey=apache_incubator-seatunnel -Dhttp.keepAlive=false 
-Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
\ No newline at end of file

Reply via email to