debug: curl Twirp probe between save and lookup, show env vars

This commit is contained in:
Hermes
2026-05-02 21:00:23 -07:00
parent 426230f6f6
commit a0a0c01217

View File

@@ -55,8 +55,38 @@ runs:
key: rust-linux-${{ steps.cache-key.outputs.hash }}
save-always: true
- name: Twirp probe via curl (debug)
shell: bash
env:
ACTIONS_CACHE_URL: ${{ env.ACTIONS_CACHE_URL }}
ACTIONS_RUNTIME_TOKEN: ${{ env.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RESULTS_URL: ${{ env.ACTIONS_RESULTS_URL }}
run: |
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 \
-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)
echo "$RESP"
else
echo "ACTIONS_CACHE_URL is empty"
fi
- name: Lookup same key immediately after save
id: cache-lookup
env:
ACTIONS_CACHE_URL: ${{ env.ACTIONS_CACHE_URL }}
ACTIONS_RUNTIME_TOKEN: ${{ env.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_CACHE_SERVICE_V2: "0"
ACTIONS_RESULTS_URL: ${{ env.ACTIONS_RESULTS_URL }}
uses: https://gitea.com/actions/cache@v3
with:
path: ~/.cargo/registry
@@ -70,3 +100,4 @@ runs:
echo "=== ~/.rustup ===" && du -sh ~/.rustup 2>/dev/null || echo "(empty)"
echo "save result: ${{ steps.cache-save.outputs.cache-hit }}"
echo "lookup result: ${{ steps.cache-lookup.outputs.cache-hit }}"
echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL"