diff --git a/.gitea/actions/rust-cache/action.yml b/.gitea/actions/rust-cache/action.yml index e378af6..af9ced9 100644 --- a/.gitea/actions/rust-cache/action.yml +++ b/.gitea/actions/rust-cache/action.yml @@ -44,6 +44,8 @@ runs: - name: Save cache id: cache-save + env: + ACTIONS_CACHE_SERVICE_V2: "0" uses: https://gitea.com/actions/cache@v3 with: path: | @@ -55,6 +57,15 @@ runs: key: rust-linux-${{ steps.cache-key.outputs.hash }} save-always: true + - name: Debug: print save outputs + shell: bash + run: | + echo "=== Save action outputs ===" + echo "cache-hit: '${{ steps.cache-save.outputs.cache-hit }}'" + echo "key: '${{ steps.cache-save.outputs.key }}'" + echo "=== All outputs ===" + env | grep -i ACTIONS_CACHE || echo "No ACTIONS_CACHE env vars in shell" + - name: Twirp probe via curl (debug) shell: bash env: @@ -65,17 +76,27 @@ runs: echo "=== Cache env vars ===" echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" echo "ACTIONS_RUNTIME_TOKEN len=${#ACTIONS_RUNTIME_TOKEN}" - echo "ACTIONS_RESULTS_URL=$ACTIONS_RESULTS_URL" if [ -n "$ACTIONS_CACHE_URL" ]; then - echo "=== Twirp probe (v1): GetCacheEntryDownloadURL ===" - BODY=$(printf '{"key":"rust-linux-%s","restoreKeys":[],"version":"%s"}' "$HASH" "$HASH") - RESP=$(curl -s -X POST \ + HASH="${{ steps.cache-key.outputs.hash }}" + KEY="rust-linux-$HASH" + echo "=== Twirp v1: GetCacheEntryDownloadURL ===" + BODY=$(printf '{"key":"%s","restoreKeys":[],"version":"%s"}' "$KEY" "$HASH") + echo "POST $ACTIONS_CACHE_URL/twirp/github.actions.results.api.v1.CacheService/GetCacheEntryDownloadURL" + echo "Body: $BODY" + RESP=$(curl -si -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACTIONS_RUNTIME_TOKEN" \ "$ACTIONS_CACHE_URL/twirp/github.actions.results.api.v1.CacheService/GetCacheEntryDownloadURL" \ -d "$BODY" \ - -w "\nHTTP_STATUS:%{http_code}" 2>&1) + 2>&1) echo "$RESP" + echo "" + echo "=== Also try list cache API ===" + LIST_RESP=$(curl -si \ + -H "Authorization: Bearer $ACTIONS_RUNTIME_TOKEN" \ + "$ACTIONS_CACHE_URL/_apis/artifactcache/caches?key=$KEY&version=$HASH" \ + 2>&1) + echo "$LIST_RESP" else echo "ACTIONS_CACHE_URL is empty" fi