[openwrt/openwrt] CI: build: split cache ccache in separate restore and save jobs

LEDE Commits lede-commits at lists.infradead.org
Tue Oct 24 08:14:37 PDT 2023


ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/c5441d24d9c51e597fc01cdca860f6fe5f4794d9

commit c5441d24d9c51e597fc01cdca860f6fe5f4794d9
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sat May 27 17:25:29 2023 +0200

    CI: build: split cache ccache in separate restore and save jobs
    
    Split caching ccache in separate restore and save jobs to always refresh
    the ccache across different runs. Currently if a key is restored, cache
    is not saved resulting in a less useful ccache that benefits from
    multiple runs.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
    (cherry picked from commit 6321361c6b13a37b0cfa279a51a0cf8239a7852c)
---
 .github/workflows/build.yml | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6948caf11e..31da7fa7ab 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -247,8 +247,9 @@ jobs:
           ./scripts/feeds update -a
           ./scripts/feeds install -a
 
-      - name: Cache ccache
-        uses: actions/cache at v3
+      - name: Restore ccache cache
+        id: restore-ccache-cache
+        uses: actions/cache/restore at v3
         with:
           path: openwrt/.ccache
           key: ccache-kernel-${{ inputs.target }}/${{ inputs.subtarget }}-${{ hashFiles('openwrt/include/kernel-**') }}
@@ -474,6 +475,12 @@ jobs:
           name: ${{ inputs.target }}-${{ inputs.subtarget }}-logs
           path: "openwrt/logs"
 
+      - name: Save ccache cache
+        uses: actions/cache/save at v3
+        with:
+          path: openwrt/.ccache
+          key: ${{ steps.restore-ccache-cache.outputs.cache-primary-key }}
+
       - name: Find external toolchain name
         id: get-toolchain-name
         if: inputs.upload_external_toolchain == true




More information about the lede-commits mailing list