From a0a0c012174703348100badf4b5755704a628991 Mon Sep 17 00:00:00 2001 From: Hermes Date: Sat, 2 May 2026 21:00:23 -0700 Subject: [PATCH] debug: curl Twirp probe between save and lookup, show env vars --- .gitea/actions/rust-cache/action.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.gitea/actions/rust-cache/action.yml b/.gitea/actions/rust-cache/action.yml index 7f1cb64..e378af6 100644 --- a/.gitea/actions/rust-cache/action.yml +++ b/.gitea/actions/rust-cache/action.yml @@ -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"