From 41c3b6565dfe45e73c235f87e3b69ccbcd76566c Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 5 Sep 2023 21:44:11 +0200 Subject: [PATCH] Improve GitHub Action caching (#2732) Use more specific keys for GitHub Action caches to make sure we update caches regularly. Also add board id to the downloads cache to get a more specific cache file. This avoid redownloading large dependencies of some boards. --- .github/workflows/dev.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 717525a8b..c4e73aabe 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -116,13 +116,18 @@ jobs: uses: actions/cache@v3 with: path: /mnt/cache/dl - key: haos-dl + key: haos-dl-${{ matrix.board.id }}-${{ hashFiles('/mnt/cache/dl/download-files.txt') }} + restore-keys: | + haos-dl-${{ matrix.board.id }} + haos-dl - name: Cache object files uses: actions/cache@v3 with: path: /mnt/cache/cc - key: haos-cc-${{ matrix.board.architecture }} + key: haos-cc-${{ matrix.board.architecture }}-${{ github.run_id }} + restore-keys: | + haos-cc-${{ matrix.board.architecture }} - name: Build run: | @@ -134,6 +139,10 @@ jobs: ${{ needs.prepare.outputs.build_container_image }} \ make BUILDDIR=/build VERSION_DEV=${{ needs.prepare.outputs.version_dev }} ${{ matrix.board.defconfig }} + - name: List downloads + run: | + find /mnt/cache/dl > /mnt/cache/dl/download-files.txt + - name: Upload images uses: burnett01/rsync-deployments@5.2 with: