lean4-htt/.github/workflows
Joachim Breitner d833f82fe8
chore: rerun CI only when full-ci label is added or removed (#4136)
Previously, the CI would run upon every label addition, including things
like `builds-mathlib`
or `will-merge-soon`, possibly triggering a new PR release, new mathlib
builds etc. Very wasteful!

Unfortunately (but not surprisingly) Github does not offer a nice way of
saying
“this workflow depends on that label, please re-run if changed”. Not
enough
functional programmer or nix enthusiasts there, I guess…

So here is the next iteration trying to work with what we have from
Github:

A new workflow watches for (only) `full-ci` label addition or deletion,
and then re-runs
the CI job for the current PR.

Sounds simple? But remember, this is github!

* `github.event.pull_request.labels.*.name` is *not* updated when a job
is re-run.

(This is actually a reasonable step towards determinism, but doesn't
help us
   constructing this work-around.)
   
   Ok, so let’s use the API to fetch the current state of the label.

* There is no good way to say “find the latest run of workflow `"CI"` on
PR `$n`”.

The best approximation seems to search by branch and triggering event.
This can
probably go wrong if there are multiple PRs from different repos with
the same
head ref name (`patch-1` anyone?). Let’s hope that it doesn’t happen too
often.

* You cannot just rerun a workflow. You can only rerun a finished
workflow. So cancel
  it first. And `sleep` a bit…

So let’s see how well this will work. It’s plausibly an improvement.
2024-05-13 16:40:36 +00:00
..
actionlint.yml chore: CI: add actionlint action, fix actions (#3156) 2024-01-15 17:53:04 +00:00
backport.yml chore: CI: add backport action 2023-09-25 11:33:14 +02:00
check-prelude.yml chore: CI: typo 2024-02-23 18:23:00 +01:00
check-stage0.yml chore: ci to set “changes-stage0” label (#3979) 2024-04-24 07:08:34 +00:00
ci.yml chore: rerun CI only when full-ci label is added or removed (#4136) 2024-05-13 16:40:36 +00:00
copyright-header.yml feat: trace.profiler export to Firefox Profiler (#3801) 2024-04-15 12:13:14 +00:00
labels-from-comments.yml chore: CI: update github-script (#3002) 2023-12-01 08:39:51 +00:00
nix-ci.yml chore: rerun CI only when full-ci label is added or removed (#4136) 2024-05-13 16:40:36 +00:00
pr-release.yml chore: Std -> Batteries renaming (#4108) 2024-05-08 05:04:25 +00:00
pr-title.yml chore: CI: update github-script (#3002) 2023-12-01 08:39:51 +00:00
restart-on-label.yml chore: rerun CI only when full-ci label is added or removed (#4136) 2024-05-13 16:40:36 +00:00
stale.yml chore: activate stale PR labeler 2023-09-20 09:18:46 +02:00
update-stage0.yml chore: Nix CI: stop pushing to cachix (#3402) 2024-02-19 16:41:20 +00:00