nix-dot-dev / getting-started-devenv-template

Based on nix.dev tutorials, repository template to get you started with Nix.
https://nix.dev
474 stars 27 forks source link

ci: use source archive rather than checkout action #29

Closed nicknovitski closed 1 year ago

nicknovitski commented 3 years ago

I think this is a sane default for the CI of nix projects hosted on github and gitlab. A typical build doesn't need git history, just the source at a fixed ref. And because of this, many projects with large histories may try to optimize their builds by using shallow clones one way or the other. But for git hosts which serve source archives, nix has a built-in capability to bypass this problem. And it gives you a single line you can use to reproduce the build locally, or from anywhere else, even in extremely minimal environments: not even git is required. e: Oh, and also, I don't know how often dependabot prompts you to update the version of the checkout action, but, this would get rid of that.

But this is all just my opinion, and I'm interested in yours. :)

One thing that I often forget and that might be worth underlining: on pull_request events, $GITHUB_REF is the last merge commit on the branch refs/pull/:prNumber/merge. So the build would not be run on the PR's comparison branch, but on the merge of it with the PR's base branch. e: You can see this in the current check result: the ref being downloaded is different from the one on my branch.

nicknovitski commented 2 years ago

Updated to resolve conflicts.

domenkozar commented 1 year ago

This template now uses https://devenv.sh/ so no more ability to do this (archive is used by default)