github: Remove github.ref from cache keys
[strongswan.git] / .github / workflows / android.yml
index 567c507..d1b909d 100644 (file)
@@ -10,7 +10,19 @@ env:
   OS_NAME: linux
 
 jobs:
   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'
+
   android:
   android:
+    needs: pre-check
+    if: ${{ needs.pre-check.outputs.should_skip != 'true' }}
     runs-on: ubuntu-latest
     env:
       TEST: android
     runs-on: ubuntu-latest
     env:
       TEST: android
@@ -26,9 +38,8 @@ jobs:
       - uses: actions/cache@v2
         with:
           path: ~/.ccache
       - uses: actions/cache@v2
         with:
           path: ~/.ccache
-          key: ccache-android-${{ github.ref }}:${{ github.sha }}
+          key: ccache-android-${{ github.sha }}
           restore-keys: |
           restore-keys: |
-            ccache-android-${{ github.ref }}:
             ccache-android-
       - run: |
           sudo apt-get install -qq ccache
             ccache-android-
       - run: |
           sudo apt-get install -qq ccache
@@ -36,8 +47,7 @@ jobs:
           ccache -z
       - uses: ./.github/actions/default
       - run: ccache -s
           ccache -z
       - uses: ./.github/actions/default
       - run: ccache -s
-      - if: ${{ success() }}
-        uses: actions/upload-artifact@v2
+      - uses: actions/upload-artifact@v2
         with:
           name: Lint Results
           path: src/frontends/android/app/build/reports/lint-results.xml
         with:
           name: Lint Results
           path: src/frontends/android/app/build/reports/lint-results.xml