aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/kernel.yml
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2023-05-30 18:57:42 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2023-05-31 13:22:05 +0200
commitebbc806d30502ff003ae7a19098c6afaaf1295a5 (patch)
tree427475e21b715735f1c1fa109bed1a4e53de32dd /.github/workflows/kernel.yml
parentff66a7c1c0f012324c0d2d90f047e6976c4fba11 (diff)
CI: add support for getting ccache cache from S3
Add support for getting ccache cache from S3. ccache is archieved in a tar and downloaded from S3 Cloud Storage. For push events, ccache is then uplodaed back to S3 to refresh and have a ccache cache always fresh. An additional workflow is added to upload files to an S3 Cloud Storage from artifacts uplodaed to github. The minio tool is used to upload files to S3. If the ccache can't be downloaded from s3, we fallback to github cache system. Also limit s3 upload to the openwrt repository since external fork won't have (obviously) the required secrtes to upload data to the S3 Cloud Storage. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to '.github/workflows/kernel.yml')
-rw-r--r--.github/workflows/kernel.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml
index d9ab8581c9..5f18a39c55 100644
--- a/.github/workflows/kernel.yml
+++ b/.github/workflows/kernel.yml
@@ -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