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
ci: init #1251
ci: init #1251
Conversation
This adds a `ci.nix` which is able to generate a `ci.yml` for use with github actions. Usage: `nix-build ci.nix --no-out-link | bash` The main idea behind generating the yaml with nix, as opposed to just writing yaml, is that Nix is easier to write and maintain. It would've taken a lot more copy-paste to achieve the same done here in raw gh actions yaml.
}]; | ||
build = mkJob [{ | ||
name = "Build"; | ||
run = "nix-build --quiet release.nix -A build.x86_64-linux -I nixpkgs=channel:19.09"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since release.nix already has a default nixpkgs, isn't adding -I nixpkgs=... asking for trouble?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was copied over from .travis.yml
run = '' | ||
cp ${ciPath} /tmp/ci.reference.yml | ||
nix-build ci.nix --no-out-link | bash | ||
diff ${ciPath} /tmp/ci.reference.yml || exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generated yml/json file is one long line. Perhaps prettifying it with jq makes it more readable and results in easier to read diffs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deferring to @grahamc, I'd be fine with that
Not sure this is a good idea. The generated file may be more verbose, but it's easier to understand. E.g. if I now need to change something to the GitHub actions, I have to figure out exactly what |
This adds a
ci.nix
which is able to generate aci.yml
for use withgithub actions.
Usage:
nix-build ci.nix --no-out-link | bash
The main idea behind generating the yaml with nix, as opposed to just
writing yaml, is that Nix is easier to write and maintain. It would've
taken a lot more copy-paste to achieve the same done here in raw gh
actions yaml.