actions / actions/toolkit

Always cache miss even the debug message show it is cached

Open
#1,418 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Thank you 🙇‍♀ for wanting to create an issue in this repository. Before you do, please ensure you are filing the issue in the right place. Issues should only be opened on if the issue relates to code in this repository.

If your issue is relevant to this repository, please include the information below:

Describe the bug

Debug logs - https://github.com/korandoru/setup-zig/actions/runs/4869953462/jobs/8685391245

Related code:

  const toolPath = cache.find('zig', versionSpec, targetPlatform)
  if (toolPath) {
    core.info(`Cache hit ${toolPath}`)
    core.addPath(toolPath)
    return
  }

// ...

  const cachedToolPath = await cache.cacheDir(extractedPath, 'zig', versionSpec, targetPlatform)
  core.info(`Cache new ${cachedToolPath}`)
  core.addPath(cachedToolPath)

But after rerun the workflow it always report cache miss.

To Reproduce

See the debug logs above.

Expected behavior

Should properly hit cache.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cache.find and cache.cacheDir calls shown in the issue and inspect the linked debug logs for the cache key, version, and target platform values. Re-run the referenced workflow after tracing those inputs; done means a second run reports a cache hit and reuses the cached Zig tool path.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.