Commit Graph

23 Commits

Author SHA1 Message Date
Michael Daniels
632c05cddc .github/actions/checkout: bump actions/github-script from 8 to 9 2026-08-08 10:34:26 -04:00
Gerhard Schwanzer
ea1628f4e7 actions/checkout: retry transient API failures
Retry transient GitHub API failures when resolving ci/pinned.json so unrelated PR jobs can continue.

Assisted-by: pi coding agent / Mika (OpenAI gpt-5.6-sol)
2026-07-10 10:47:08 +02:00
Ihar Hrachyshka
09ddb874c1 github: Serialize git worktree initialization
Fixes #511286
2026-04-20 20:10:40 -04:00
Michael Daniels
8adaa85a7c actions/checkout: log disk usage after checkout, don't use tmpfs on MacOS
We run out of disk on the latest pinned version on MacOS only, because by
default this allocates 50% of memory for the tmpfs, which is 3.5GB on MacOS
(and 4GB on Linux).

We can't increase to 4GB, though, because we get the error
"Desired memsize 4294967296 too large - defaulting to 3758096384 bytes"
if we do.

The logging I add would have saved me a lot of trouble figuring this out.
2026-04-04 16:13:11 -04:00
Michael Daniels
0535f37693 actions/checkout: update github-script action
Dependabot missed this in #441182.
2026-03-29 17:47:06 -04:00
Matt Sturgeon
79f6bf1d2d actions/checkout: manually fetch ci/pinned.json patch
In a shallow clone, `git fetch` may fail to apply thin packs due to
missing base objects.

We typically don't notice this with first-parent commits and prospective
merge commits, but it seems fairly common with arbitrary PR-branch
commits.

In this instance we don't need the full commit data, we only need to
apply its diff as a patch. So fetch the diff from GitHub's API and apply
using `git apply`.

This partially reverts commit 4787f35ede
2026-01-22 00:30:25 +00:00
Matt Sturgeon
4787f35ede actions/checkout: handle ci/pinned.json bump commits 2026-01-20 17:13:42 -03:00
Matt Sturgeon
c25dd6c655 actions/checkout: update input descriptions
In fb32eb0f29 we moved the checked-out
worktrees into a `nixpkgs` directory. Update the input descriptions to
reflect this.
2025-08-22 17:30:44 +01:00
Wolfgang Walther
c18d1e4af8 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.
2025-08-22 12:54:28 +02:00
Wolfgang Walther
fb32eb0f29 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.
2025-08-22 09:45:34 +02:00
Wolfgang Walther
4b4aa628da actions/checkout: parallelize checkout of multiple commits on tmpfs
Instead of fetching up to 3 times on each new checkout, we now fetch all
the commits we're going to need at once. Afterwards, we checkout the
different worktrees in parallel, which doesn't give us much, yet,
because it would still be IO-bound on its own. Inconsistent IO
performance on disk is also the biggest limitation for checkout right
now, where checkout times range everywhere from 20s to 40s.

By checking out the worktrees on a tmpfs, the actual checkout only takes
1s and benefits from parallelization. The overall checkout time is now
8-11s, depending on the number of commits.

That's a reduction of 10-30s and we get this speedup for almost every
job in the PR workflow, which is huge.

This potentially has a nice side-effect for Eval, too: Because the repo
is in RAM, Eval seems to run slightly faster, up to 10 seconds less.
2025-08-21 21:53:49 +02:00
Wolfgang Walther
f01b6b4754 actions/checkout: remove unused input types
The two as-at inputs, were not boolean anymore, but GHA didn't complain.
Input types are actually not a thing for composite actions - they are
only documented for callable workflows.
2025-08-20 18:52:20 +02:00
Wolfgang Walther
7ab632b30f actions/checkout: rename inconsistent pinned-from input 2025-08-20 17:17:07 +02:00
Wolfgang Walther
b51e104439 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.
2025-08-20 17:17:04 +02:00
Wolfgang Walther
c787c66de6 ci/github-script/prepare: init from actions/get-merge-commit
This just moves the code over to ci/github-script to make it easy to
test and iterate on locally.

The name `prepare` is chosen, because the script will be extended with
the other steps from "PR / prepare" next.
2025-08-20 15:16:15 +02:00
Wolfgang Walther
2087f1be30 actions/get-merge-commit: remove push branch
This action will not be called for push events anymore. For those, the
`push.yml` workflow is run instead, which hardcodes `mergedSha`.
2025-08-20 15:16:14 +02:00
Wolfgang Walther
46d5594714 actions/get-merge-commit: bump actions/checkout to v5.0.0
A previous commit from Dependabot did this for all the workflows, but
Dependabot doesn't update the actions folder, apparently.
2025-08-11 17:58:12 +02:00
Wolfgang Walther
8a9f0b8a47 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.
2025-08-11 17:57:11 +02:00
Wolfgang Walther
09ddb1a8a0 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.
2025-06-20 09:22:48 +02:00
Wolfgang Walther
8ec23df6f6 ci/treefmt: add yamlfmt
Most workflow files are already well formatted, but to make it easier to
keep it that way, we can add yamlfmt.

I personally have a preference for non-indented arrays for YAML, but
wanted to avoid bigger diffs here - the status-quo clearly are indented
arrays.

Some changes are made manually to the get-merge-commit action and the
issue templates. Those would otherwise make yamlfmt misbehave on those.
2025-06-12 14:47:42 +02:00
Wolfgang Walther
0e1c284b13 workflows: checkout nixpkgs in get-merge-commit action
This makes checking out the nixpkgs repo even more consistent and almost
forces us to use the trusted/untrusted path pattern.
2025-05-25 15:14:23 +02:00
Wolfgang Walther
539e8d4f66 actions/get-merge-conflict: refactor
Using core.setOutput is much nicer than having to parse the json
"result" on the outside. This also avoids some very odd errors, when the
result can, for unknown reasons, *not* be parsed as JSON later on.

Also avoiding a bit of duplication between the "if mergeable" branches.
2025-05-25 14:32:51 +02:00
Wolfgang Walther
e48d9d6174 workflows/get-merge-commit: move to composite action
We don't need a separate workflow anymore, because we don't need to skip
dependent jobs on failures anymore. The biggest failure mode was
"conflict" previously, but we resolved that on the last commit. The
remaining failure modes are so rare, that it's OK to just fail the jobs
in this case instead of marking them as "skipped". Especially, because
the resolve-merge-commit job would have previously failed anyway.

By moving this to an action we avoid running separate jobs each time we
need the merge commit. This also makes the check list in PRs much
cleaner.
2025-05-23 23:06:20 +02:00