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

RFC: save cache on post #37

Merged
merged 1 commit into from
Apr 21, 2020
Merged

RFC: save cache on post #37

merged 1 commit into from
Apr 21, 2020

Conversation

zimbatm
Copy link
Contributor

@zimbatm zimbatm commented Apr 10, 2020

This breaks backward-compatibility and changes the action to be more in line with what I would expect this action to do. Which is to only setup the cache, and then upload all the extra build closures at the end of the job. It's a bit like actions/cache in that sense.

@zimbatm zimbatm changed the title WIP: save cache on post RFC: save cache on post Apr 10, 2020
@zimbatm
Copy link
Contributor Author

zimbatm commented Apr 10, 2020

For some reason I get the following error when using this branch:

Error: Cannot find module '@actions/core'

I don't know why yet.

@domenkozar
Copy link
Member

One of the design goals in mind that I had is that you can push to multiple caches in a single job. Typically some to a public cache and some to a private cache.

Maybe that was fighting more against the design of actions given that they've introduced the post hook and that actions/cache uses it that way.

Probably https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds is a better solution to such requirement.

The reason you get that error is that you have to commit node_modules when action is released. I was planning to rewrite it to bash as all the other actions.

@zimbatm zimbatm mentioned this pull request Apr 10, 2020
@zimbatm
Copy link
Contributor Author

zimbatm commented Apr 10, 2020

One of the design goals in mind that I had is that you can push to multiple caches in a single job. Typically some to a public cache and some to a private cache.

Ok, I need to think more about that because it's not a scenario I had in mind.

Is the idea that the private cache would include everything that is in the public cache + some private bits? With the idea that internal clients can only consume from the private cache and avoid the overhead of multiple queries inherent from setting up multiple caches at the same time?

Instead of trying to do everything in the action, push the cache at the
end. This allows to run other actions in between.
@zimbatm
Copy link
Contributor Author

zimbatm commented Apr 17, 2020

@domenkozar how about this:

If the action has postPush: true then the post action is enabled and skipNixBuild is also assumed to be true. The action stays backward-compatible. The only downside is that the post-build step will now appear on all of the jobs even if they don't use that feature.

@zimbatm
Copy link
Contributor Author

zimbatm commented Apr 17, 2020

As an example: here we want to run nixops deploy --build-only to make sure that the deployment will work: nix-community/infra@69cf40d

@domenkozar domenkozar merged commit 490a246 into cachix:master Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants