Commit graph

22 commits

Author SHA1 Message Date
Wolfgang Walther
f7c25f0bf9
ci/pinned: manage nixpkgs and treefmt-nix with npins
Instead of rolling our own update script which only works for a single
pin, let's use npins. We can then use it for the treefmtNix pin as well,
which was mostly unmaintained, so far.
2025-06-02 09:13:11 +02:00
Wolfgang Walther
ef1077013b
workflows/manual-nixpkgs: build nixpkgs manual on staging and stable branches
By using the pinned nixpkgs we have for CI, we can lift the restriction
of building the nixpkgs manual only in PRs targeting master.

At the same time, this uses the pinned nixpkgs for the doc/ folder's dev
shell. This allows entering that shell while working on a staging-based
branch and write documentation.

Why should staging be un(der)documented, after all?

Note: The package that is available in nixpkgs as pkgs.nixpkgs-manual
will still be built with the current nixpkgs checkout, not the pinned
version. This is the same that hydra builds.
2025-05-29 17:06:40 +02:00
Wolfgang Walther
942c377476
workflows/nixpkgs-vet: use nixpkgs-vet from pinned nixpkgs
We have added nixpkgs-vet as a regular package to nixpkgs a while ago,
so we can now use it from pinned nixpkgs. This avoids pulling a
platform-specific binary version from upstream.

This change also allows to run the tool easily locally, the same way as
other tools:

  nix-build ci -A nixpkgs-vet

This will do a full check of the repo with the exception of
nixpkgs-vet's "ratchet" checks: Those depend on having two branches to
compare, but the default is to only look at the head branch. Those
ratchet checks will still be run in CI, though.
2025-05-25 15:01:42 +02:00
Wolfgang Walther
1893f5439e
workflows/check-format: run on all files
This was run on .nix files only, but we recently added keep-sorted,
editorconfig-checker and actionlint to treefmt, so CI needs to check all
files instead.
2025-05-13 08:24:25 +02:00
Jörg Thalheim
53a79ee500
workflows/check-format: add actionlint (#406114) 2025-05-11 12:55:51 +02:00
Jörg Thalheim
7fd771ee97
ci: allow running jobs locally (#404466) 2025-05-11 12:28:04 +02:00
Wolfgang Walther
101a271eed
ci/parse: test for nix 2.3 and lix
This adds the minimum nix version and the latest lix version to the
matrix of parse checks. Especially the minimum nix version is relevant,
because parsing routinely breaks because of introduction of newer
syntax.

Adding lix just completes the picture.
2025-05-11 12:14:59 +02:00
Wolfgang Walther
a553ef2950
ci/parse: init
The nix-parse workflow can now be run locally the same way as in CI.

To do this, the CI's workflow was slightly adjusted. Instead of testing
only the changed files, we're now testing all files in the repository.

This is possible in two ways:

1. By calling nix-instantiate once with all files as arguments. This
will be rather fast, but only the first error is shown before it errors
out.
2. By calling nix-instantiate once for each file. This will be much
slower, but has the advantage that we see all errors at once.

To avoid running the long variant every time, we first do a quick check
with the fast version. If that fails, we run the slower one to report
the errors. This gives us the best of both.
2025-05-11 12:14:57 +02:00
Wolfgang Walther
8b65ba5b8e
workflows/check-format: add actionlint
I added a lint-action.sh script in .github/workflows a while ago while
fixing some warnings. But I haven't run it myself ever since. This needs
to be part of CI to make any use of it.
2025-05-11 11:06:06 +02:00
Wolfgang Walther
7c16d15d7f
ci/shell: init
The dev shell can now be built locally the same way as in CI with:

  nix-build ci -A shell
2025-05-10 22:14:16 +02:00
Wolfgang Walther
d253ad12b2
ci/manual-nixpkgs: init
The Nixpkgs manual can now be built locally the same way as in CI with:

  nix-build ci -A manual-nixpkgs -A manual-nixpkgs-tests
2025-05-10 22:14:15 +02:00
Wolfgang Walther
89520b962a
ci/manual-nixos: init
The NixOS manual can now be built locally the same way as in CI with:

  nix-build ci -A manual-nixos
2025-05-10 22:13:58 +02:00
Wolfgang Walther
1cb7a384e0
workflows/keep-sorted: drop and move to treefmt
Same reasoning as the commit before, but keep-sorted has even less
overhead than editorconfig-checker. Benchmark has it at 1 second per
run.
2025-05-09 21:54:12 +02:00
Wolfgang Walther
ba4fe10465
workflows/editorconfig: drop and move to treefmt
We already have treefmt running for nixfmt, so it's easy to just add
another formatter to it. This gives a much better UX, because all
formatting errors are reported through the same channel.

It also saves us one CI job, which takes most of the time to just set up
the machine, clone the repo and download Nix - while doing a minimum of
actual work.

Total execution time for treefmt is ~10% slower:
- 38s only nixfmt
- 43s nixfmt + editorconfig-checker
2025-05-09 21:09:47 +02:00
Wolfgang Walther
7097614efd
ci/lib-tests: init
This allows running the lib-tests locally in exactly the same way that
they are run in CI:

  nix-build ci -A lib-tests
2025-05-09 20:06:25 +02:00
Silvan Mosberger
927521a6ac workflows/check-nix-format: Enforce formatting on all files
Changes the Nix format checking workflow to now strictly enforce
formatting of all Nix files using the treefmt setup introduced
in the pre-previous commit.

This is in [accordance with the approved RFC 166](https://github.com/NixOS/rfcs/blob/master/rfcs/0166-nix-formatting.md#reformat-nixpkgs).

Note that the "skip treewide" thing is no longer necessary, already
before, because there's nothing that would fail for treewide changes.
Previously the problem was that the GitHub API would be bombarded.
2025-04-01 20:09:45 +02:00
Silvan Mosberger
5a8296d74f flake.nix: Set formatter
This enables `nix fmt`, though it won't be practically usable without
also reformatting all files, which is done in a following commit.
2025-04-01 20:09:44 +02:00
Silvan Mosberger
398e74f70b shell: Introduce treefmt
Introduces treefmt with a simple nixfmt-rfc-style configuration to
format all Nix files.

This is only practically usable with the following commit that formats
all files accordingly.
2025-04-01 20:09:44 +02:00
Silvan Mosberger
fbbe972898 Parallel GH actions workflow for Nixpkgs eval
Motivated by ofborg struggling [1] and its evaluations taking too long,
inspired by Jörg's initial PR [2]
and Adam's previous attempt to parallelise Nixpkgs evaluation [3],
this PR contains initial work to relief ofborg from its evaluation duty
by using GitHub Actions to evaluate Nixpkgs.

For now this doesn't take care of all of what ofborg does, such as
requesting appropriate reviewers or labeling mass rebuilds, but this can
be follow-up work.

[1]: https://discourse.nixos.org/t/infrastructure-announcement-the-future-of-ofborg-your-help-needed/56025?u=infinisil
[2]: https://github.com/NixOS/nixpkgs/pull/352808
[3]: https://github.com/NixOS/nixpkgs/pull/269403

Co-Authored-By: Jörg Thalheim <joerg@thalheim.io>
Co-Authored-By: Adam Joseph <adam@westernsemico.com>
2024-11-20 10:35:56 +01:00
Silvan Mosberger
5695bf6cfe ci: Add codeowners validator 2024-10-08 22:14:59 +02:00
Silvan Mosberger
369cfa02da ci: Add review request scripts
Also post a comment in case base branch is wrong
  This guides newcomers in how to smoothly handle the potentially scary
  situation of having thousands of commits listed in a PR.

  While CI shows the same, people might not even look at CI if the PR
  looks botched.
2024-10-08 22:14:01 +02:00
Silvan Mosberger
1700d00588 ci: Add default.nix with exposed pkgs
Allows reusing it in more places
2024-10-08 22:13:59 +02:00