mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-23 04:56:31 +00:00
Optimize build cache for dev builds (#2872)
* Optimize build cache for dev builds * Remove downloaded files cache, as it doesn't save that much time and it can't fit into the repo cache limit, randomly causing eviction of CC object cache for a single board. * Limit saving of the object cache only to the dev branch, because of the restrictions for the cache access limit us from effectively using the cache for rc/main branches anyway. * Adjust names of the steps a bit for clarity. * Add printing of some cache stats * Compare old ccache files' age to Makefile
This commit is contained in:
parent
252887cc0d
commit
6e8568c666
23
.github/workflows/build.yaml
vendored
23
.github/workflows/build.yaml
vendored
@ -178,13 +178,7 @@ jobs:
|
||||
sudo mkdir /mnt/cache
|
||||
sudo chown -R runner:runner /mnt/cache
|
||||
|
||||
- name: Cache downloads
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: /mnt/cache/dl
|
||||
key: haos-dl
|
||||
|
||||
- name: Cache object files
|
||||
- name: "Restore cache: object files"
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: /mnt/cache/cc
|
||||
@ -227,18 +221,19 @@ jobs:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: output/images/haos_*
|
||||
|
||||
- name: Cache downloads
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: /mnt/cache/dl
|
||||
key: haos-dl-${{ github.run_id }}
|
||||
|
||||
- name: Cache build
|
||||
- name: "Save cache: object files"
|
||||
if: github.ref == 'refs/heads/dev'
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
path: /mnt/cache/cc
|
||||
key: haos-cc-${{ matrix.board.id }}-${{ github.run_id }}
|
||||
|
||||
- name: Print cache stats
|
||||
run: |
|
||||
echo "Cache size: $(du -sh /mnt/cache/cc)"
|
||||
echo "Files total: $(find /mnt/cache/cc -mindepth 1 -type f | wc -l)"
|
||||
echo "Old files: $(find /mnt/cache/cc -mindepth 1 -type f -not -anewer output/Makefile | wc -l)"
|
||||
|
||||
- name: Upload ova image to artifacts for test job
|
||||
uses: actions/upload-artifact@v3
|
||||
if: ${{ matrix.board.id == 'ova' }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user