cache-nix-action icon indicating copy to clipboard operation
cache-nix-action copied to clipboard

How to store cache even if some step fails?

Open hissssst opened this issue 2 years ago • 7 comments

Hi, thanks for this awesome action!

The question is how do I store the nix store even if some step is failing in the CI?

hissssst avatar Aug 01 '23 12:08 hissssst

You may allow a step to fail using continue-on-error.

deemp avatar Aug 03 '23 11:08 deemp

@deemp the pipeline proceeds after failing, but the cache is not restored. Please reopen

hissssst avatar Aug 31 '23 16:08 hissssst

Please, try the latest version of cache-nix-action and provide logs from both phases (the first and the post phases).

deemp avatar Aug 31 '23 21:08 deemp

@hissssst, there's now the save-always input (see Inputs).

deemp avatar Mar 31 '24 07:03 deemp

save-always: true is not working

hissssst avatar Apr 19 '24 15:04 hissssst

@hissssst, yes. This problem is tracked in https://github.com/nix-community/cache-nix-action/issues/36 with more details

deemp avatar Apr 19 '24 17:04 deemp

@hissssst, as it was suggested in https://github.com/actions/cache/issues/1315#issuecomment-2163822166, you can use separate restore and save steps.

deemp avatar Aug 23 '24 15:08 deemp