github: Remove github.ref from cache keys
[strongswan.git] / .github / workflows / sonarcloud.yml
index aa6a411..c647579 100644 (file)
@@ -9,7 +9,19 @@ env:
   OS_NAME: linux
 
 jobs:
+  pre-check:
+    runs-on: ubuntu-latest
+    outputs:
+      should_skip: ${{ steps.skip-check.outputs.should_skip }}
+    steps:
+      - id: skip-check
+        uses: fkirc/skip-duplicate-actions@master
+        with:
+          concurrent_skipping: 'same_content'
+
   sonarcloud:
+    needs: pre-check
+    if: ${{ needs.pre-check.outputs.should_skip != 'true' }}
     runs-on: ubuntu-latest
     env:
       TEST: sonarcloud
@@ -22,9 +34,8 @@ jobs:
           path: |
             ~/.ccache
             ~/.sonar-cache
-          key: ccache-sonarcloud-${{ github.ref }}:${{ github.sha }}
+          key: ccache-sonarcloud-${{ github.sha }}
           restore-keys: |
-            ccache-sonarcloud-${{ github.ref }}:
             ccache-sonarcloud-
       - run: |
           sudo apt-get install -qq ccache
@@ -34,7 +45,7 @@ jobs:
       # for C builds, so we follow the "any CI" instructions
       - name: Install sonar-scanner
         env:
-          SONAR_SCANNER_VERSION: 4.4.0.2170
+          SONAR_SCANNER_VERSION: 4.6.2.2472
         run: |
           export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
           curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip