actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.91k stars 965 forks source link

Actions cache does not actually work #3316

Open davhdavh opened 5 months ago

davhdavh commented 5 months ago

Describe the bug

https://github.com/actions/runner/blob/edfdbb966118990c9898c6723121f5610188c155/src/Runner.Common/HostContext.cs#L280-L283

Specifies that the actions cache is a subfolder of the work folder, but the work folder is always totally reset.

To Reproduce Steps to reproduce the behavior:

  1. Run a workflow that uses any action -> observe in the "Set up Job" part of the run that it downloads the action(s) (ie, the text from https://github.com/actions/runner/blob/edfdbb966118990c9898c6723121f5610188c155/src/Runner.Worker/ActionManager.cs#L778)
  2. Run same work -> observe in the "Set up Job" part of the run that it downloads the action(s)

Expected behavior

  1. same
  2. Action is already downloaded -> ie, the text from https://github.com/actions/runner/blob/edfdbb966118990c9898c6723121f5610188c155/src/Runner.Worker/ActionManager.cs#L770

Runner Version and Platform

latest, any os

Job Log Output

Download action repository 'actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808' (SHA:65462800fd760344b1a7b4382951275a0abb4808)

Suggested fix:

https://github.com/actions/runner/blob/edfdbb966118990c9898c6723121f5610188c155/src/Runner.Common/HostContext.cs#L282

Change to .Tools instead of .Work

davhdavh commented 4 months ago

Anyone?