Skip to content

Commit d9a6a53

Browse files
authored
[github][ci]: add concurrency control to GitHub Actions (#10761)
ci: add concurrency control to GitHub Actions
1 parent 3dd4f71 commit d9a6a53

12 files changed

+57
-9
lines changed

.github/workflows/action_tools.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ on:
2929
workflow_dispatch:
3030
repository_dispatch:
3131

32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
34+
cancel-in-progress: true
35+
3236
permissions:
3337
contents: read # to fetch code (actions/checkout)
3438

@@ -93,4 +97,4 @@ jobs:
9397
scons --pyconfig-silent -C $TEST_BSP_ROOT/dist/project
9498
scons --pyconfig-silent -C $TEST_BSP_ROOT/rt-studio-project
9599
scons -C $TEST_BSP_ROOT/dist/project
96-
scons -C $TEST_BSP_ROOT/rt-studio-project
100+
scons -C $TEST_BSP_ROOT/rt-studio-project

.github/workflows/auto_assign_reviewers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ on:
2020
branches: [ master ]
2121
types: [opened, synchronize, reopened]
2222

23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
2327
jobs:
2428
assign-reviewers:
2529
runs-on: ubuntu-22.04

.github/workflows/auto_labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ name: "Pull Request Labeler"
1515
on:
1616
- pull_request_target
1717

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
21+
1822
jobs:
1923
labeler:
2024
permissions:

.github/workflows/bsp_buildings.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ on:
4747
- online-pkgs-static-building-trigger-event
4848
workflow_dispatch:
4949

50+
concurrency:
51+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
52+
cancel-in-progress: true
53+
5054
permissions:
5155
contents: read # to fetch code (actions/checkout)
5256

.github/workflows/compile_bsp_with_drivers.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ name: BSP compilation with more drivers
1515
on:
1616
workflow_dispatch: #disable
1717

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
21+
1822
permissions:
1923
contents: read # to fetch code (actions/checkout)
2024

@@ -54,4 +58,4 @@ jobs:
5458
shell: bash
5559
run: |
5660
# source ~/.env/env.sh
57-
# python tools/ci/compile_bsp_with_drivers.py
61+
# python tools/ci/compile_bsp_with_drivers.py

.github/workflows/doxygen.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ on:
3131
schedule:
3232
- cron: '0 16 30 * *'
3333
workflow_dispatch:
34+
35+
concurrency:
36+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
37+
cancel-in-progress: true
3438

3539
permissions:
3640
contents: read
@@ -74,4 +78,4 @@ jobs:
7478
steps:
7579
- name: Deploy to GitHub Pages
7680
id: deployment
77-
uses: actions/deploy-pages@main
81+
uses: actions/deploy-pages@main

.github/workflows/format_check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
- '**/README.md'
1010
- '**/README_zh.md'
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
scancode_job:
1418
runs-on: ubuntu-22.04
@@ -25,4 +29,4 @@ jobs:
2529
shell: bash
2630
run: |
2731
pip install click chardet PyYaml
28-
python tools/ci/file_check.py check 'https://github.com/RT-Thread/rt-thread' 'master'
32+
python tools/ci/file_check.py check 'https://github.com/RT-Thread/rt-thread' 'master'

.github/workflows/pkgs_test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
- '**/README_zh.md'
1818
workflow_dispatch:
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
22+
cancel-in-progress: true
23+
2024
jobs:
2125
change:
2226
uses: RT-Thread/pkgs-test/.github/workflows/pkgs-action.yml@main
@@ -25,5 +29,4 @@ jobs:
2529
rt-thread-versions: "branch:master"
2630
test-specific-pkgs: true
2731
pkgs: |
28-
hello
29-
32+
hello

.github/workflows/pr_clang_format.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
required: true
1717
default: ''
1818

19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
1923
permissions:
2024
contents: write
2125
pull-requests: read
@@ -262,4 +266,4 @@ jobs:
262266
echo "排除模式: ${{ github.event.inputs.exclude_patterns || '无' }}"
263267
echo "处理文件数: ${{ steps.find-files.outputs.files_count }}"
264268
echo "有更改: ${{ steps.check-changes.outputs.has_changes }}"
265-
echo "clang-format 版本: $(clang-format --version | head -1)"
269+
echo "clang-format 版本: $(clang-format --version | head -1)"

.github/workflows/pr_format_bot.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33
pull_request_target:
44
types: [opened]
55

6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
611
permissions:
712
pull-requests: write
813
contents: read
@@ -133,4 +138,4 @@ jobs:
133138
echo "Failed to get commits from GitHub API"
134139
echo "Response: $commits"
135140
exit 1
136-
fi
141+
fi

0 commit comments

Comments
 (0)