From 838ddd606f5744c09901256380dc7d7cb5f2b485 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:48:39 +0100 Subject: [PATCH 1/6] MAINT: Add clear-cache job --- .github/workflows/test.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6aca0c6..7ada4af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,8 +14,24 @@ env: PIXI_VERSION: "v0.63.0" jobs: - # TODO: Add a job that clears the GitHub cache + clear-cache: + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: Clear pixi-lock cache entries + env: + GH_TOKEN: ${{ github.token }} + run: | + echo "Clearing pixi-lock-* cache entries" + gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock-' | while read -r key; do + echo "Deleting cache: $key" + gh cache delete "$key" --repo ${{ github.repository }} + done + echo "Cache cleared" + cache-pixi-lock: + needs: clear-cache runs-on: ubuntu-latest outputs: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} From 4ec0d719ee2813e805a7432702911341a21c53d9 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:55:47 +0100 Subject: [PATCH 2/6] Fix grep --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ada4af..5f9133b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | echo "Clearing pixi-lock-* cache entries" - gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock-' | while read -r key; do + gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock_' | while read -r key; do echo "Deleting cache: $key" gh cache delete "$key" --repo ${{ github.repository }} done From ba42b40b87f9952852ebea82469cc955eb30a36b Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:01:27 +0100 Subject: [PATCH 3/6] Add logic to retry cache deletions --- .github/workflows/test.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f9133b..c884864 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,8 +26,21 @@ jobs: echo "Clearing pixi-lock-* cache entries" gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock_' | while read -r key; do echo "Deleting cache: $key" - gh cache delete "$key" --repo ${{ github.repository }} + for attempt in 1 2 3; do + if gh cache delete "$key" --repo ${{ github.repository }}; then + break + fi + echo "Attempt $attempt failed, retrying in 5 seconds..." + sleep 5 + done done + echo "Verifying all caches are cleared..." + remaining=$(gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock_' || true) + if [ -n "$remaining" ]; then + echo "Error: Some caches still exist:" + echo "$remaining" + exit 1 + fi echo "Cache cleared" cache-pixi-lock: From a203a591a95a20bec6470151b5b881d7ddeb518c Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:10:08 +0100 Subject: [PATCH 4/6] Add sleep --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c884864..752e573 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,7 @@ jobs: echo "$remaining" exit 1 fi + sleep 5 echo "Cache cleared" cache-pixi-lock: From 824ef576e1a4ffa4e5107de963d49d69314c3eea Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:10:15 +0100 Subject: [PATCH 5/6] Update to ubuntu-slim --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 752e573..7656891 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ env: jobs: clear-cache: - runs-on: ubuntu-latest + runs-on: ubuntu-slim permissions: actions: write steps: @@ -46,7 +46,7 @@ jobs: cache-pixi-lock: needs: clear-cache - runs-on: ubuntu-latest + runs-on: ubuntu-slim outputs: cache-key: ${{ steps.create-and-cache.outputs.cache-key }} pixi-version: ${{ steps.create-and-cache.outputs.pixi-version }} @@ -82,7 +82,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-slim, macos-latest, windows-latest] steps: - name: Checkout repository uses: actions/checkout@v6 From 602be7209b4936036bb793e4bb01be33b1360138 Mon Sep 17 00:00:00 2001 From: Vecko <36369090+VeckoTheGecko@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:15:02 +0100 Subject: [PATCH 6/6] move sleep --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7656891..d12f5f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,7 @@ jobs: sleep 5 done done + sleep 5 echo "Verifying all caches are cleared..." remaining=$(gh cache list --repo ${{ github.repository }} --json key --jq '.[].key' | grep '^pixi-lock_' || true) if [ -n "$remaining" ]; then @@ -41,7 +42,6 @@ jobs: echo "$remaining" exit 1 fi - sleep 5 echo "Cache cleared" cache-pixi-lock: