question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Split this action into save-cache and restore-cache actions

See original GitHub issue

Proposal: Split this action into two, similar to actions/upload-artifact / actions/download-artifact (also similar to what CircleCI does):

  • actions/save-cache
  • actions/restore-cache

Rationale: This will give the user a lot more control (e.g. I might want to save the cache even before running the test steps).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:26
  • Comments:20 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
wipe2238commented, Nov 4, 2019

If you fork this repo, you have just one upstream. If you’re writing complex pull request, you do it in one place. If you find bug which requires both loading and saving in specific order to reproduce, you report it in one place instead of guessing which one fits best or writing in both. If you want to use older version for any reason, you set one sha instead of two. And if you want to move to newer, but still not-so-fresh version, you just update that sha instead of tracking which changes in repository A will work with repository B.

That’s what we have now, with one repo.

I like the idea of controlling when exactly cache should be loaded/saved. But splitting repo for this is overkill. If that’s what’s needed to have more control (no idea honestly - not an actions writer yet, i stick to workflows for now), split load and save into two actions in separate folders which sounds like best of two worlds to me.

- uses: actions/cache/load

# ...

- uses: actions/cache/save
10reactions
wipe2238commented, Nov 4, 2019

Why not add argument instead?

- uses: actions/cache
  with:
   mode: load

# ...

- uses: actions/cache
  with:
   mode: save
Read more comments on GitHub >

github_iconTop Results From Across the Web

golangci-lint-action/run.ts at master - GitHub
Official GitHub action for golangci-lint from its authors ... import * as core from "@actions/core" ... import { restoreCache, saveCache } from "./cache"....
Read more >
Using GitHub cache action with multiple cache paths?
I was able to make it work with a few modifications;. use relative paths instead of absolute; use a hash of the content...
Read more >
What is a Harness Variable Expression? - Harness.io Docs
A split method is called with the argument ('\.'), and the result is a Java array, returning the first item, [0].
Read more >
How to use the hasha.fromFileSync function in hasha - Snyk
fromFileSync examples, based on popular ways it is used in public projects. ... restoreCache, saveCache } = require('cache/lib/index') const fs ...
Read more >
GitHub Actionsのキャッシュをより細かく制御する ... - ぽよメモ
GitHub Actionsのキャッシュにおいて、そのリストアと保存を別々に制御する機能が ... Split this action into save-cache and restore-cache actions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found