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.
This commit is contained in:
Stefan Agner 2023-09-05 21:44:11 +02:00 committed by GitHub
parent 79050fb820
commit 41c3b6565d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: