Просмотр исходного кода

[github][ci]: add concurrency control to GitHub Actions (#10761)

ci: add concurrency control to GitHub Actions
CYFS 3 месяцев назад
Родитель
Сommit
d9a6a5307b

+ 5 - 1
.github/workflows/action_tools.yml

@@ -29,6 +29,10 @@ on:
   workflow_dispatch:
   repository_dispatch:
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 permissions:
   contents: read # to fetch code (actions/checkout)
 
@@ -93,4 +97,4 @@ jobs:
         scons --pyconfig-silent -C $TEST_BSP_ROOT/dist/project
         scons --pyconfig-silent -C $TEST_BSP_ROOT/rt-studio-project
         scons -C $TEST_BSP_ROOT/dist/project
-        scons -C $TEST_BSP_ROOT/rt-studio-project
+        scons -C $TEST_BSP_ROOT/rt-studio-project

+ 4 - 0
.github/workflows/auto_assign_reviewers.yml

@@ -20,6 +20,10 @@ on:
     branches: [ master ]
     types: [opened, synchronize, reopened]
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 jobs:
   assign-reviewers:
     runs-on: ubuntu-22.04

+ 4 - 0
.github/workflows/auto_labeler.yml

@@ -15,6 +15,10 @@ name: "Pull Request Labeler"
 on:
 - pull_request_target
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 jobs:
   labeler:
     permissions:

+ 4 - 0
.github/workflows/bsp_buildings.yml

@@ -47,6 +47,10 @@ on:
       - online-pkgs-static-building-trigger-event
   workflow_dispatch:
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 permissions:
   contents: read # to fetch code (actions/checkout)
 

+ 5 - 1
.github/workflows/compile_bsp_with_drivers.yml

@@ -15,6 +15,10 @@ name: BSP compilation with more drivers
 on:
   workflow_dispatch: #disable
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 permissions:
   contents: read # to fetch code (actions/checkout)
 
@@ -54,4 +58,4 @@ jobs:
         shell: bash
         run: |
           # source ~/.env/env.sh
-          # python tools/ci/compile_bsp_with_drivers.py
+          # python tools/ci/compile_bsp_with_drivers.py

+ 5 - 1
.github/workflows/doxygen.yml

@@ -31,6 +31,10 @@ on:
   schedule:
     - cron:  '0 16 30 * *'
   workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
   
 permissions:
   contents: read
@@ -74,4 +78,4 @@ jobs:
     steps:
       - name: Deploy to GitHub Pages
         id: deployment
-        uses: actions/deploy-pages@main
+        uses: actions/deploy-pages@main

+ 5 - 1
.github/workflows/format_check.yml

@@ -9,6 +9,10 @@ on:
       - '**/README.md'
       - '**/README_zh.md'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 jobs:
   scancode_job:
     runs-on: ubuntu-22.04
@@ -25,4 +29,4 @@ jobs:
         shell: bash
         run: |
           pip install click chardet PyYaml
-          python tools/ci/file_check.py check 'https://github.com/RT-Thread/rt-thread' 'master'
+          python tools/ci/file_check.py check 'https://github.com/RT-Thread/rt-thread' 'master'

+ 5 - 2
.github/workflows/pkgs_test.yml

@@ -17,6 +17,10 @@ on:
           - '**/README_zh.md'
     workflow_dispatch:
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 jobs:
     change:
         uses: RT-Thread/pkgs-test/.github/workflows/pkgs-action.yml@main
@@ -25,5 +29,4 @@ jobs:
             rt-thread-versions: "branch:master"
             test-specific-pkgs: true
             pkgs: |
-                hello
-
+                hello

+ 5 - 1
.github/workflows/pr_clang_format.yml

@@ -16,6 +16,10 @@ on:
         required: true
         default: ''
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 permissions:
   contents: write
   pull-requests: read
@@ -262,4 +266,4 @@ jobs:
           echo "排除模式: ${{ github.event.inputs.exclude_patterns || '无' }}"
           echo "处理文件数: ${{ steps.find-files.outputs.files_count }}"
           echo "有更改: ${{ steps.check-changes.outputs.has_changes }}"
-          echo "clang-format 版本: $(clang-format --version | head -1)"
+          echo "clang-format 版本: $(clang-format --version | head -1)"

+ 6 - 1
.github/workflows/pr_format_bot.yml

@@ -3,6 +3,11 @@ on:
   pull_request_target:
     types: [opened]
 
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 permissions:
   pull-requests: write
   contents: read
@@ -133,4 +138,4 @@ jobs:
             echo "Failed to get commits from GitHub API"
             echo "Response: $commits"
             exit 1
-          fi
+          fi

+ 5 - 1
.github/workflows/static_code_analysis.yml

@@ -19,6 +19,10 @@ on:
       - '**/README.md'
       - '**/README_zh.md'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 jobs:
   scancode_job:
     runs-on: ubuntu-22.04
@@ -50,4 +54,4 @@ jobs:
           sudo make install FILESDIR=/usr/local/share/Cppcheck 
           cppcheck --version
           cd ..
-          python tools/ci/cpp_check.py check
+          python tools/ci/cpp_check.py check

+ 4 - 0
.github/workflows/utest_auto_run.yml

@@ -19,6 +19,10 @@ on:
       - '**/README.md'
       - '**/README_zh.md'
 
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
+  cancel-in-progress: true
+
 permissions:
   contents: read