diff --git a/.gitea/workflows/main.yml b/.gitea/workflows/main.yml index 4c48b774..5311e09a 100644 --- a/.gitea/workflows/main.yml +++ b/.gitea/workflows/main.yml @@ -29,9 +29,14 @@ on: permissions: contents: read +# One group per trigger and branch. A newer push cancels the older push run on the same branch, and a +# newer nightly the older nightly, queued or running: the newer run tests everything the older one +# would have, and the runner is shared. A push leaves a nightly alone (the nightly has jobs a push +# does not), and a manual run cancels only an older manual run on the same branch. Gitea cancels the +# queued and blocked runs of a group even without cancel-in-progress; with it, the running ones too. concurrency: - group: main-${{ github.ref }} - cancel-in-progress: false + group: main-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true env: # Reuse would hand one lane a container another lane had already faulted. diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 32d8ae8a..fa082b97 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -14,6 +14,9 @@ on: permissions: contents: read +# One group per pull request: the ref of a pull_request run is refs/pull//head. A push to the +# pull request cancels the run of the head it replaces, queued or running, so the one runner spends +# its slot on the head that can merge. concurrency: group: pr-${{ github.ref }} cancel-in-progress: true