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

ci: init #1251

Merged
merged 2 commits into from Mar 12, 2020
Merged

ci: init #1251

merged 2 commits into from Mar 12, 2020

Conversation

lovesegfault
Copy link
Member

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.

@grahamc grahamc closed this Mar 12, 2020
@grahamc grahamc reopened this Mar 12, 2020
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.
@grahamc grahamc merged commit 8262e7d into NixOS:master Mar 12, 2020
}];
build = mkJob [{
name = "Build";
run = "nix-build --quiet release.nix -A build.x86_64-linux -I nixpkgs=channel:19.09";
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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

@edolstra
Copy link
Member

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 ci.nix is doing. (Lisp curse and all that.)

@grahamc grahamc added this to the 2.0 milestone Apr 20, 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.

None yet

4 participants