diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4803d34ec..57e4062c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -276,9 +276,11 @@ jobs: - name: Tidy cache working-directory: ${{ env.DEV_DRIVE_WORKSPACE }}/src - shell: bash + shell: pwsh run: | - find ${{ env.DEV_DRIVE_WORKSPACE }}/cigocacher -type f -mmin +90 -delete + Get-ChildItem -Path "${{ env.DEV_DRIVE_WORKSPACE }}\cigocacher" -File -Recurse | + Where-Object { $_.LastAccessTime -lt (Get-Date).AddMinutes(-90) } | + Remove-Item -Force win-tool-go: # windows-8vpu is a 2022 GitHub-managed runner in our diff --git a/cmd/cigocacher/disk.go b/cmd/cigocacher/disk.go index e5a8d04f8..9537e8126 100644 --- a/cmd/cigocacher/disk.go +++ b/cmd/cigocacher/disk.go @@ -53,7 +53,7 @@ func (dc *DiskCache) Get(ctx context.Context, actionID string) (outputID, diskPa dc.logf("disk miss: %v", actionID) } } - return "", "", err + return "", "", fmt.Errorf("failed to os.ReadFile in Get: %w", err) } var ie indexEntry if err := json.Unmarshal(ij, &ie); err != nil { @@ -146,7 +146,7 @@ func (dc *DiskCache) Put(ctx context.Context, actionID, outputID string, size in return "", err } if _, err := writeAtomic(actionFile, bytes.NewReader(ij)); err != nil { - return "", err + return "", fmt.Errorf("atomic write failed: %w", err) } return outputFile, nil }