cache compose tests

This commit is contained in:
Elio Bischof
2025-06-19 10:23:24 +02:00
parent 7ff15fe2a4
commit 34830ed0b7
2 changed files with 4 additions and 3 deletions

View File

@@ -67,4 +67,4 @@ jobs:
with: with:
path: ${{ env.CACHE_DIR }} path: ${{ env.CACHE_DIR }}
key: ${{ steps.run-caches-restore.outputs.cache-primary-key }} key: ${{ steps.run-caches-restore.outputs.cache-primary-key }}
if: always() # if: always()

View File

@@ -18,8 +18,7 @@ DIGEST_FILE="$CACHE_DIR/$MAKE_TARGET.digests"
mkdir -p "$CACHE_DIR" mkdir -p "$CACHE_DIR"
get_image_ids() { get_image_ids() {
local depot_pull_out=$(depot pull 2>&1) local ids=""
local ids=""
for img in $(echo "$IMAGES"); do for img in $(echo "$IMAGES"); do
local id=$(docker image inspect "$img" --format='{{.Id}}' 2>/dev/null || true) local id=$(docker image inspect "$img" --format='{{.Id}}' 2>/dev/null || true)
if [[ -z $id ]]; then if [[ -z $id ]]; then
@@ -41,6 +40,8 @@ OLD_DIGEST=$(cat "$DIGEST_FILE" 2>/dev/null || echo "")
OLD_STATUS=$(echo "$OLD_DIGEST" | cut -d ';' -f1) OLD_STATUS=$(echo "$OLD_DIGEST" | cut -d ';' -f1)
OLD_IDS=$(echo "$OLD_DIGEST" | cut -d ';' -f2-99) OLD_IDS=$(echo "$OLD_DIGEST" | cut -d ';' -f2-99)
CURRENT_IMAGE_IDS=$(get_image_ids) CURRENT_IMAGE_IDS=$(get_image_ids)
docker images
echo $CURRENT_IMAGE_IDS
if [[ "$OLD_IDS" == "$CURRENT_IMAGE_IDS" ]]; then if [[ "$OLD_IDS" == "$CURRENT_IMAGE_IDS" ]]; then
if [[ "$FORCE" == "true" ]]; then if [[ "$FORCE" == "true" ]]; then
echo "\$FORCE=$FORCE - Running $MAKE_TARGET despite unchanged images." echo "\$FORCE=$FORCE - Running $MAKE_TARGET despite unchanged images."