You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by el...@apache.org on 2020/05/27 13:50:03 UTC

[incubator-ratis] branch master updated: RATIS-940. Add sonar check for ratis (#108)

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

elek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new 00f1747  RATIS-940. Add sonar check for ratis (#108)
00f1747 is described below

commit 00f1747a1915f42fd256e9a5b7b8e0131cd06c2c
Author: Dinesh Chitlangia <di...@gmail.com>
AuthorDate: Wed May 27 09:49:25 2020 -0400

    RATIS-940. Add sonar check for ratis (#108)
---
 .github/workflows/post-commit.yml |  4 ++++
 dev-support/checks/sonar.sh       | 23 +++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/.github/workflows/post-commit.yml b/.github/workflows/post-commit.yml
index 949b92f..f185e1a 100644
--- a/.github/workflows/post-commit.yml
+++ b/.github/workflows/post-commit.yml
@@ -49,6 +49,10 @@ jobs:
     runs-on: ubuntu-18.04
     steps:
         - uses: actions/checkout@master
+        - run: ./dev-support/checks/sonar.sh
+          env:
+            SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
+            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         - run: ./dev-support/checks/unit.sh
         - uses: actions/upload-artifact@master
           if: always()
diff --git a/dev-support/checks/sonar.sh b/dev-support/checks/sonar.sh
new file mode 100755
index 0000000..053c031
--- /dev/null
+++ b/dev-support/checks/sonar.sh
@@ -0,0 +1,23 @@
+#!/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.
+DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
+cd "$DIR/../.." || exit 1
+
+if [ ! "$SONAR_TOKEN" ]; then
+  echo "SONAR_TOKEN environment variable should be set"
+  exit 1
+fi
+mvn -B verify -DskipShade -DskipTests org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-ratis