Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade actions/cache to v2. #129

Open
ewestern opened this issue Mar 23, 2021 · 6 comments
Open

Upgrade actions/cache to v2. #129

ewestern opened this issue Mar 23, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@ewestern
Copy link

Caching using actions/cache v1.x limits cacheable events to push and pull_request as described here:
https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache

Using actions/cache v2.x will allow cacheable workflows on any event that has a GITHUB_REF.

At the moment, I can't have a cacheable workflow started by a release event. Making this change would facilitate this workflow.

@ewestern ewestern added the enhancement New feature or request label Mar 23, 2021
@rcowsill
Copy link
Contributor

This is a bit confusing; this action doesn't use actions/cache (an action), instead it uses @actions/cache (a package on npm).

The actions/cache@v2 action uses the package @actions/[email protected] internally. That's the latest version, and it's the same version being used by this action.

That means this action should already work fine in workflows triggered by any event with a GITHUB_REF. Do you have a workflow run log* where it failed in such a case?

* preferably with ACTIONS_STEP_DEBUG enabled

@ewestern
Copy link
Author

Oh interesting. Sorry for the misunderstanding there.
I'll try to get the debug output. In the meantime, the behavior I am seeing is that:

  • If the action is triggered by on: push, then caching works fine.
  • If, on the other hand, it is triggered by
on:
  release:
    types: [created]

Then the step fails with:

Run satackey/[email protected]
  with:
    key: feed-cache-{hash}
    restore-keys: feed-cache-
  
    concurrency: 4
    skip-save: false
  env:
     ***
Root cache could not be found. aborting.

@amjanoni
Copy link

Oh interesting. Sorry for the misunderstanding there.
I'll try to get the debug output. In the meantime, the behavior I am seeing is that:

  • If the action is triggered by on: push, then caching works fine.
  • If, on the other hand, it is triggered by
on:
  release:
    types: [created]

Then the step fails with:

Run satackey/[email protected]
  with:
    key: feed-cache-{hash}
    restore-keys: feed-cache-
  
    concurrency: 4
    skip-save: false
  env:
     ***
Root cache could not be found. aborting.

Having the same issue here when using with:

`on:
  release:
    types:
      - released
      - prereleased`

@rcowsill
Copy link
Contributor

Having the same issue here when using with:

`on:
  release:
    types:
      - released
      - prereleased`

Can you share workflow run logs? As well as the on: release run log it would be good to see the log for the run creating the cache you expected it to use.

For both logs it would help a lot if they had ACTIONS_STEP_DEBUG enabled.

@dzervas
Copy link

dzervas commented Mar 25, 2022

Triggering through tags is also uncached:

on:
  push:
    tags:
      - v*

@dzervas
Copy link

dzervas commented Mar 25, 2022

Apparently the problem was that on each run I had a different env var. When I reran the job the cache was fetched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants