Open GeunSam2 opened 3 months ago
i have same problem ! what we can do to fix it ???
I suppose it has the same nature as described here https://github.com/actions/cache/issues/1455#issuecomment-2328358604
The problem, I believe, is here:
const workspace = process.env['GITHUB_WORKSPACE'] ?? process.cwd()
const globber = await glob.create(patterns.join('\n'), {
implicitDescendants: false
})
for await (const file of globber.globGenerator()) {
const relativeFile = path
.relative(workspace, file)
.replace(new RegExp(`\\${path.sep}`, 'g'), '/')
core.debug(`Matched: ${relativeFile}`)
It uses path.relative()
to resolve file
relative to workspace, but that is not what path.relative
does. The docs state:
The path.relative() method returns the relative path from from to to based on the current working directory. If from and to each resolve to the same path (after calling path.resolve() on each), a zero-length string is returned.
It is doing the relative path to something based on the current working directory. Here is a simple test.
$ mkdir /tmp/foo && cd /tmp/foo
$ node
> path.relative("/a/b/c", "../q")
'../../../tmp/q'
I think they were looking for ../q
, i.e. "q as relative to /a/b/c
, and not "how do I get to q relative to abc given my current working directory?"
I should open an issue there, or make a dedicated one here.
Description
There is a cache compatibility issue between ARC (Action Runner Controller) runners and non-ARC runners in GitHub Actions. Caches created by ARC runners cannot be restored by non-ARC runners, and vice versa. This issue limits the interoperability between different runner environments, causing inefficiencies in workflows that utilize both ARC and non-ARC runners.
Steps to Reproduce
Scenario 1: Non-ARC to ARC
First Job: Non-ARC Runner (e.g., Self-hosted, github hosted ...)
Second Job: ARC Runner
Scenario 2: ARC to Non-ARC
First Job: ARC Runner
Second Job: Non-ARC Runner
Expected Behavior
The cache should be successfully restored across different runner environments.
Actual Behavior
The cache fails to restore, displaying a "Cache not found" message, despite the cache being available and correctly generated.
Additional Information
enableCrossOsArchive
set to true to allow cross-OS cache compatibility.Environment Details
Impact
This issue limits the flexibility and interoperability of using different runner types within the same workflow, leading to inefficiencies and potential workflow redesign to avoid mixed runner environments.