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 builds for PRs #18

Closed
cleeyv opened this issue Jul 18, 2023 · 3 comments
Closed

CI builds for PRs #18

cleeyv opened this issue Jul 18, 2023 · 3 comments
Assignees
Labels
infra Work on Ngipkgs itself, and related infrastructure

Comments

@cleeyv
Copy link
Collaborator

cleeyv commented Jul 18, 2023

The ngi0 hydra is configured to build all the packages in ngipkgs: https://hydra.ngi0.nixos.org/jobset/ngipkgs/main#tabs-jobs however, this can only be run for specific branches, not for new PRs, hence the need for a parallel CI solution.

CI has been implemented for PRs using github actions: 4dfa911
Currently it is running nix flake check, which confirms that everything evaluates, and runs all tests, but provides no way to check that all packages build correctly. This is a feature that has been requested more than once over the past few years:
NixOS/nix#3811
NixOS/nix#7165
The first request noted that it would be "very useful in the context of a monorepo". In the comments of the second request, there are some workarounds mentioned, such as adding all packages as "checks" so that they will be built by nix flake check, or using symlinkJoin to create a single derivation containing all packages which can then be set to the default package for the flake and more easily built in CI: https://www.tweag.io/blog/2022-09-22-rust-nix/

@cleeyv cleeyv added the infra Work on Ngipkgs itself, and related infrastructure label Jul 18, 2023
@cleeyv cleeyv self-assigned this Jul 18, 2023
@github-project-automation github-project-automation bot moved this to under mobsideration in Summer of Nix Jul 18, 2023
@cleeyv
Copy link
Collaborator Author

cleeyv commented Jul 19, 2023

I tried the symlinkJoin method first but couldn't get it to work. Then I tried adding it to the checks, and once I figured out how to do it, it was very simple: 99ba38f
I got inspiration from this implementation of a package build check, which seemed to be also having problems with unwanted darwin builds: ngi-nix/pgp-milter@cae9fd3

The result when I pushed the new commit was a CI run that was 8 minutes long (compared to the previous 3 minutes without builds), with logs that included builds of the packages! https://github.com/ngi-nix/ngipkgs/actions/workflows/ci.yaml

The remaining step is testing to confirm that this works as intended with a PR.

@mightyiam
Copy link
Member

Brilliant.

@cleeyv
Copy link
Collaborator Author

cleeyv commented Jul 19, 2023

Confirmed that it is working as intended on PRs: #20

@cleeyv cleeyv closed this as completed Jul 19, 2023
@github-project-automation github-project-automation bot moved this from under mobsideration to mobleted in Summer of Nix Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Work on Ngipkgs itself, and related infrastructure
Projects
Status: mobleted
Development

No branches or pull requests

2 participants