Skip to content

Commit b49ffb6

Browse files
committed
ci: Add concurrency groups to workflows
Added concurrency control to workflows to automatically cancel outdated runs when new commits are pushed. This prevents resource waste when multiple commits are pushed in quick succession to the same PR or branch Signed-off-by: Omar <omar.brbutovic@secomind.com>
1 parent 318f7fe commit b49ffb6

File tree

8 files changed

+37
-3
lines changed

8 files changed

+37
-3
lines changed

.github/workflows/backend-ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ on:
3535
- ".tool-versions"
3636
- ".github/workflows/backend-*.yaml"
3737

38+
concurrency:
39+
group: "${{ github.workflow }}-${{ github.ref }}"
40+
cancel-in-progress: true
41+
3842
jobs:
3943
warmup-cache:
4044
uses: ./.github/workflows/backend-warmup-cache.yaml

.github/workflows/check-license-year.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
pull_request:
2323
types: [opened, synchronize, reopened]
2424

25+
concurrency:
26+
group: "${{ github.workflow }}-${{ github.ref }}"
27+
cancel-in-progress: true
28+
2529
permissions:
2630
contents: read
2731

.github/workflows/docs-workflow.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Edgehog.
33
#
4-
# Copyright 2021-2025 SECO Mind Srl
4+
# Copyright 2021 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -43,6 +43,10 @@ on:
4343
- "main"
4444
- "release-*"
4545

46+
concurrency:
47+
group: "${{ github.workflow }}-${{ github.ref }}"
48+
cancel-in-progress: true
49+
4650
jobs:
4751
docs:
4852
if: github.repository_owner == 'edgehog-device-manager'

.github/workflows/frontend-ci.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ on:
3737
- ".tool-versions"
3838
- ".github/workflows/frontend-ci.yaml"
3939

40+
concurrency:
41+
group: "${{ github.workflow }}-${{ github.ref }}"
42+
cancel-in-progress: true
43+
4044
jobs:
4145
warmup-cache:
4246
uses: ./.github/workflows/frontend-warmup-cache.yaml

.github/workflows/frontend-codeql-analysis.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ on:
3838
workflow_dispatch:
3939
schedule:
4040
- cron: "33 5 * * 6"
41+
42+
concurrency:
43+
group: "${{ github.workflow }}-${{ github.ref }}"
44+
cancel-in-progress: true
45+
4146
permissions:
4247
contents: read
4348
defaults:

.github/workflows/pr-fast-forward-check.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Edgehog.
33
#
4-
# Copyright 2025 SECO Mind Srl
4+
# Copyright 2025 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -22,6 +22,11 @@ name: pull-request
2222
on:
2323
pull_request:
2424
types: [opened, reopened, synchronize]
25+
26+
concurrency:
27+
group: "${{ github.workflow }}-${{ github.ref }}"
28+
cancel-in-progress: true
29+
2530
jobs:
2631
check-fast-forward:
2732
runs-on: ubuntu-latest

.github/workflows/pr-lint.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Edgehog.
33
#
4-
# Copyright 2025 SECO Mind Srl
4+
# Copyright 2025 - 2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -25,6 +25,10 @@ permissions:
2525

2626
on: pull_request
2727

28+
concurrency:
29+
group: "${{ github.workflow }}-${{ github.ref }}"
30+
cancel-in-progress: true
31+
2832
env:
2933
CLICOLOR: 1
3034

.github/workflows/reuse-lint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ name: REUSE Compliance Check
66

77
on: [push, pull_request]
88

9+
concurrency:
10+
group: "${{ github.workflow }}-${{ github.ref }}"
11+
cancel-in-progress: true
12+
913
jobs:
1014
test:
1115
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)