nix-community / cache-nix-action

Cache Nix store in GitHub Actions to speed up workflows [maintainer=@deemp]
MIT License
34 stars 7 forks source link

How to store cache even if some step fails? #8

Open hissssst opened 1 year ago

hissssst commented 1 year ago

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?

deemp commented 1 year ago

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

hissssst commented 1 year ago

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

deemp commented 1 year ago

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

deemp commented 6 months ago

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

hissssst commented 5 months ago

save-always: true is not working

deemp commented 5 months ago

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

deemp commented 1 month ago

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