fix: only cache java packages and not source content (#1750)

* fix: only cache java packages and not source content

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>

* fix: add gradle to matched files for ci checksum

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>

---------

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
Christopher Angelo Phillips 2023-04-19 16:07:34 -04:00 committed by GitHub
parent 98a6c6efbe
commit a42bac6fcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ jobs:
- name: Restore Java test-fixture cache - name: Restore Java test-fixture cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: syft/pkg/cataloger/java/test-fixtures/java-builds path: syft/pkg/cataloger/java/test-fixtures/java-builds/packages
key: ${{ runner.os }}-unit-java-cache-${{ hashFiles( 'syft/pkg/cataloger/java/test-fixtures/java-builds/cache.fingerprint' ) }} key: ${{ runner.os }}-unit-java-cache-${{ hashFiles( 'syft/pkg/cataloger/java/test-fixtures/java-builds/cache.fingerprint' ) }}
- name: Restore RPM test-fixture cache - name: Restore RPM test-fixture cache

View File

@ -74,5 +74,5 @@ $(PKGSDIR)/gcc-amd64-darwin-exec-debug:
# we need a way to determine if CI should bust the test cache based on the source material # we need a way to determine if CI should bust the test cache based on the source material
.PHONY: cache.fingerprint .PHONY: cache.fingerprint
cache.fingerprint: cache.fingerprint:
find example-* build-* Makefile -type f -exec sha256sum {} \; | sort | tee /dev/stderr | tee cache.fingerprint find example* build* gradle* Makefile -type f -exec sha256sum {} \; | sort | tee /dev/stderr | tee cache.fingerprint
sha256sum cache.fingerprint sha256sum cache.fingerprint