You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2022/11/05 12:18:16 UTC

[lucenenet] branch master updated: ci: Added sonar workflow (#709)

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

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new 10c24f293 ci: Added sonar workflow (#709)
10c24f293 is described below

commit 10c24f2939e334a0690fc5436a81c7fbfcad97f4
Author: Nikolaj Brask-Nielsen <ni...@gmail.com>
AuthorDate: Sat Nov 5 13:18:11 2022 +0100

    ci: Added sonar workflow (#709)
    
    * ci: Added sonar workflow
    
    * ci: Updated sonar workflow
    
    * Updated sonar.yml to use Apache SONARCLOUD_TOKEN
    
    https://cwiki.apache.org/confluence/display/INFRA/SonarCloud+for+ASF+projects
    
    * sonar.yml: Use SONARCLOUD_TOKEN secret directly
    
    * sonar.yml: Added license header
    
    * Added schedule trigger (daily 12:36 PM UTC) and workflow_dispatch trigger, removed pull_request trigger
    
    Co-authored-by: Shad Storhaug <sh...@shadstorhaug.com>
---
 .github/workflows/sonar.yml | 64 +++++++++++++++++++++++++++++++++++++++++++++
 ACKNOWLEDGEMENTS.txt        |  2 +-
 2 files changed, 65 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
new file mode 100644
index 000000000..9094b457b
--- /dev/null
+++ b/.github/workflows/sonar.yml
@@ -0,0 +1,64 @@
+# 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:
+  workflow_dispatch:
+  push:
+    branches:
+      - master
+  schedule:
+    - cron: '36 12 * * *' # 12:36 PM UTC, daily (picked an odd start time to try to avoid competing for agents with other projects)
+jobs:
+  build:
+    name: Build and analyze
+    runs-on: windows-latest
+    steps:
+      - name: Set up JDK 11
+        uses: actions/setup-java@v1
+        with:
+          java-version: 1.11
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - name: Cache SonarCloud packages
+        uses: actions/cache@v1
+        with:
+          path: ~\sonar\cache
+          key: ${{ runner.os }}-sonar
+          restore-keys: ${{ runner.os }}-sonar
+      - name: Cache SonarCloud scanner
+        id: cache-sonar-scanner
+        uses: actions/cache@v1
+        with:
+          path: .\.sonar\scanner
+          key: ${{ runner.os }}-sonar-scanner
+          restore-keys: ${{ runner.os }}-sonar-scanner
+      - name: Install SonarCloud scanner
+        if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
+        shell: powershell
+        run: |
+          New-Item -Path .\.sonar\scanner -ItemType Directory
+          dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
+      - name: Build and analyze
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
+        shell: powershell
+        run: |
+          .\.sonar\scanner\dotnet-sonarscanner begin /k:"apache_lucenenet" /o:"apache" /d:sonar.login="${{ secrets.SONARCLOUD_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
+          dotnet build
+          .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONARCLOUD_TOKEN }}"
diff --git a/ACKNOWLEDGEMENTS.txt b/ACKNOWLEDGEMENTS.txt
index 91fd0e2fb..73cddf1fd 100644
--- a/ACKNOWLEDGEMENTS.txt
+++ b/ACKNOWLEDGEMENTS.txt
@@ -9,4 +9,4 @@ The full snowball package is available from http://snowball.tartarus.org/
 Apache Lucene.Net is a port of Jakarta Lucene to C#.  
 The port from Java to C# of versions 1.4.0, 1.4.3, 1.9, 1.9.1, 2.0 and 2.1 were done 
 primarily by George Aroush. To contact George Aroush please visit http://www.aroush.net/.
-Much thanks to George
\ No newline at end of file
+Much thanks to George