CI: add support for getting ccache cache from S3
[openwrt/staging/hauke.git] / .github / workflows / kernel.yml
index d9ab8581c9b455968ce36731b9a8b7335e149b07..5f18a39c55322271d6e5291a9c210965946d4ed9 100644 (file)
@@ -117,6 +117,7 @@ jobs:
       subtarget: ${{ matrix.subtarget }}
       build_kernel: true
       build_all_kmods: true
+      upload_ccache_cache: ${{ github.repository_owner == 'openwrt' }}
 
   check-kernel-patches:
     name: Check Kernel patches
@@ -133,3 +134,20 @@ jobs:
       target: ${{ matrix.target }}
       subtarget: ${{ matrix.subtarget }}
 
+  upload-ccache-cache-in-s3:
+    if: github.event_name == 'push' && github.repository_owner == 'openwrt'
+    name: Upload ccache cache to s3
+    needs: [determine_targets, build]
+    strategy:
+       fail-fast: False
+       matrix:
+         include: ${{fromJson(needs.determine_targets.outputs.targets_subtargets)}}
+    secrets:
+      s3_access_key: ${{ secrets.GCS_S3_ACCESS_KEY }}
+      s3_secret_key: ${{ secrets.GCS_S3_SECRET_KEY }}
+    uses: ./.github/workflows/upload-file-s3.yml
+    with:
+      endpoint: https://storage.googleapis.com
+      bucket: openwrt-ci-cache
+      download_id: ${{ matrix.target }}-${{ matrix.subtarget }}-ccache-cache
+      filename: ccache-kernel-${{ matrix.target }}-${{ matrix.subtarget }}.tar