Commit Graph

27 Commits

Author SHA1 Message Date
dependabot[bot]
ec3f65fdfd build(deps): bump cachix/install-nix-action from 31.6.0 to 31.6.1
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.6.0 to 31.6.1.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](56a7bb7b56...7be5dee142)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit c4fd1f6500)
2025-09-08 12:23:32 +00:00
dependabot[bot]
f8ecf8cc37 build(deps): bump cachix/install-nix-action from 31.5.2 to 31.6.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.5.2 to 31.6.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](fc6e360bed...56a7bb7b56)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit df934c4327)
2025-09-02 08:33:34 +00:00
Wolfgang Walther
0807259075 actions/checkout: always checkout pinned commits
With the latest performance improvements, this only adds up to 1s, but
reduces complexity in managing pinned checkouts explicitly, especially
when we need *both* pinned checkouts in the next commit.

(cherry picked from commit c18d1e4af8)
2025-08-22 11:53:56 +00:00
Wolfgang Walther
1ca8505578 actions/checkout: use single tmpfs with subfolders
This fixes problems on darwin, where the new tmpfs folder would not be
fully empty, but git only creates worktrees on fully empty directories.

(cherry picked from commit fb32eb0f29)
2025-08-22 10:13:11 +00:00
Wolfgang Walther
a4251b7612 [Backport release-25.05] ci/github-script/prepare: move more steps from workflow (#435325) 2025-08-20 17:51:00 +00:00
Wolfgang Walther
70fc919bde actions/checkout: rename inconsistent pinned-from input
(cherry picked from commit 7ab632b30f)
2025-08-20 16:58:10 +00:00
Wolfgang Walther
7d405339b3 actions/checkout: rename from actions/get-merge-commit
This moves the logic to "check whether the PR can be merged and
determine the relevant commits" into the PR / prepare job directly -
since that's the only place where it is supposed to be used.

Because of the if condition in get-merge-commit, this logic was run
multiple times, for example in the lint workflow, where only one of
targetSha or mergedSha was provided as input. However, this input was
thrown away directly. This might not be a big problem, because this was
not expensive, so far. But with the next commit, this will become more
so.

This also separates the logic a bit cleaner - `prepare` figures out all
the parameters for the whole PR workflow, while `checkout` handles the
consistency around these checkouts.

(cherry picked from commit b51e104439)
2025-08-20 16:58:10 +00:00
Wolfgang Walther
4c5bae6e3f workflows/build: prevent pushing tarball to cachix
By definition the tarball changes on every commit, so it makes no sense
to cache it - it will just waste disk space.

(cherry picked from commit ac93865697)
2025-08-20 16:54:40 +00:00
Wolfgang Walther
e3ff0fab42 workflows: never push source to cachix
Pushing the source path to cachix is pointless, because the only source
we're using is Nixpkgs - and that will always be available already via
checkout. No need to ever substitute it, so no need to push it either.

(cherry picked from commit 2400bdf0d4)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
28c86b2359 workflows: support cachix in forks
This allows setting up a custom cachix cache in a contributor's fork.
That's most valuable when working on CI itself, testing and interating
in a fork. It's required when working on cachix related features
directly.

(cherry picked from commit 025424913f)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
52a04aef17 workflows/build: build shells on a single darwin runner only
Because we have Rosetta, we can use a single darwin runner to build both
shells. Most time is spent for downloading Nix and checking out Nixpkgs
anyway and this can be saved if only run once.

Also, this prepares for the deprecation of the old macos-13 runners,
which were based on x86_64 CPUs in September 2025:
https://github.blog/changelog/2025-07-11-upcoming-changes-to-macos-hosted-runners-macos-latest-migration-and-xcode-support-policy-updates/

(cherry picked from commit 56d29bbae1)
2025-08-11 16:15:49 +00:00
Wolfgang Walther
fb86dcb57c workflows/build: avoid downloading from cachix
This avoids downloading results from cachix, when they don't need to be
rebuilt, which just wastes time and resources.

(cherry picked from commit f105ab12f6)
2025-08-11 16:15:49 +00:00
Wolfgang Walther
06c8d5c918 workflows: checkout pinned nixpkgs explicitly
This is slightly faster than downloading and extracting a tarball and
additionally allows a sparse checkout. No need to download docs or nixos
for our purpose.

The data is quite noisy, but suggests improvements from anywhere between
5-15 seconds for each job using the pinned nixpkgs.

(cherry picked from commit 8a9f0b8a47)
2025-08-11 16:04:16 +00:00
Wolfgang Walther
15e17895b5 workflows: remove extra_nix_config.sandbox
This is true by default anyway.

(cherry picked from commit de7aa9f213)
2025-08-11 16:04:16 +00:00
dependabot[bot]
c3969b49ee build(deps): bump actions/checkout from 4.2.2 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 593aee095f)
2025-08-11 17:45:44 +02:00
dependabot[bot]
8704c56787 build(deps): bump cachix/install-nix-action from 31.4.1 to 31.5.2
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.4.1 to 31.5.2.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](f0fe604f8a...fc6e360bed)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.5.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit b455a0a294)
2025-08-11 17:45:40 +02:00
Wolfgang Walther
63301f9889 .github/workflows: set timeouts
None of our jobs is expected to run for 6 hours, the GitHub limit. These
limits are generous and take into accounts that some jobs need to wait
for others.

If jobs exceed these times, most likely something else is wrong and
needs investigation.

(cherry picked from commit 436d54174d)
2025-08-09 19:11:02 +00:00
Wolfgang Walther
d3a5485375 workflows/build: build nixpkgs tarball
This adds a build job for the tarball, which might help uncover eval
issues on attributes not normally touched by Eval, aka those added in
`pkgs/top-level/packages-config.nix`.

(cherry picked from commit bfb20b9fea)
2025-07-24 10:34:29 +00:00
Michael Daniels
9ccb036e43 workflows/build: be clearer about what is being built
Committers could get the false impression from, e.g., `PR / Build / aarch64-linux` that this workflow builds the packages changed in the current PR. Such a misunderstanding could pair poorly with the "enable auto-merge" button, once that's enabled.

(cherry picked from commit 261bba1fcd)
2025-07-11 15:50:18 +00:00
Wolfgang Walther
a46e9b4393 workflows: nix: 2.29.0 -> 2.29.1
(cherry picked from commit ea10312659)
2025-06-24 16:46:17 +00:00
Wolfgang Walther
9a42b59630 workflows/pr: refactor base/head branch decision making
Some jobs purposefully only run on certain base or head branches. By
centralizing the logic, parts of it can easily be re-used later. Also,
this gives them an explicit name and thus makes them easier to
understand.

(cherry picked from commit 7763be5a80)
2025-06-23 10:54:39 +00:00
Wolfgang Walther
5d1d71680c workflows: sync merge commits
This fixes a problem where each workflow would get their own merge
commit. This happens frequently when the target branch is merged into a
the same time, different workflows in the same run will run
get-merge-commit at different times and thus have different merge
commits.

Since the jobs don't really depend on each other, this doesn't cause
practical problems, yet. But it has already led to strange CI failures
in a still unmerged PR, which can be prevented from happening with this
clean approach.

And yes, this saves a few API calls on every run.

(cherry picked from commit 09ddb1a8a0)
2025-06-20 11:02:07 +00:00
Wolfgang Walther
9eb06853d9 workflows/{pr,push}: init
Those two workflows bundle all the main jobs in two event-specific
wrapper workflows. This enables us to do two things later on:
- Synchronize the merge commits between most of the jobs run in a PR.
- Create a single "required" job to be targeted by GitHub's "required
status checks to pass" feature.

(cherry picked from commit 959eed1f2a)
2025-06-18 12:17:58 +00:00
Wolfgang Walther
23be6b9693 treewide: run yamlfmt
This applies changes from running yamlfmt with the `retain_line_breaks`
formatting option enabled.

(cherry picked from commit 66981875e8)
2025-06-15 12:27:17 +02:00
Wolfgang Walther
4aa51a994c workflows/{labels,reviewers}: fix concurrency groups for nested workflows
This didn't work as intended. When a workflow is run with
`workflow_call`, it will have `github.workflow` set to the *parent*
workflow. So the `caller` input that we passed, resulted in this
concurrency key:

```
Eval-Eval-...
```

But that's bad, because the labels and reviewers workflows will cancel
each other!

What we actually want is this:
- Label and Reviewers workflow should have different groups.
- Reviewers called via Eval and called directly via undraft should have
*different* groups.

We can't use the default condition we use everywhere else, because
`github.workflow` is the same for Label and Reviewers. Thus, we hardcode
the workflow's name as well. This essentially means we have this as a
key:

```
<name-of-running-workflow>-<name-of-triggering-workflow>-<name-of-event>-<name-of-head-branch>
```

This should do what we want.

Since workflows can be made reusable workflows later on, we add those
hardcoded names to *all* concurrency groups. This avoids copy&paste
errors later on.

(cherry picked from commit 6793e238fa)
2025-06-14 14:27:37 +02:00
Wolfgang Walther
93ecbedbae workflows: prevent accidental cancelling of other PRs
This can happen when two PRs run at the same time, which come from
different forks, but have the same head branch name.

github.head_ref is suggested by GitHub's docs, but.. that's not really
useful for cases with forks.

(cherry picked from commit 7ba7720b28)
2025-06-14 14:27:32 +02:00
Wolfgang Walther
d39cc5ac0d workflows/build: build all the basics in a single workflow
This new workflow builds both manuals, the shell and the lib tests all
in a matrix of four jobs. This allows re-using the shared checkout and
the pinned nixpkgs download and saves time in the most likely cache: No
changes, just download from cache. Each step checks the cancelled
condition, which causes it to run even if the previous steps failed.
This way we get a full picture even if the first step fails immediately.

This could later be optimized to build more in parallel as well, but
we'll first need to clear the conditions on building the manuals on the
master branch only.

This reduces the number of jobs from up to 8 to 4 for this part.

(cherry picked from commit cd82aa54f5)
2025-06-13 10:12:08 +00:00