From 6718a2f2857ad9cc7210f867288c9f56ec3a9045 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Mon, 12 Jun 2023 09:50:57 +0800 Subject: [PATCH] [workflow] cancel duplicated workflow jobs (#3960) --- .github/workflows/build_on_pr.yml | 9 +++++++++ .github/workflows/compatiblity_test_on_pr.yml | 6 ++++++ .github/workflows/doc_check_on_pr.yml | 6 ++++++ .github/workflows/doc_test_on_pr.yml | 6 ++++++ .github/workflows/example_check_on_pr.yml | 6 ++++++ 5 files changed, 33 insertions(+) diff --git a/.github/workflows/build_on_pr.yml b/.github/workflows/build_on_pr.yml index 8b2253e57..513de40b7 100644 --- a/.github/workflows/build_on_pr.yml +++ b/.github/workflows/build_on_pr.yml @@ -60,6 +60,9 @@ jobs: defaults: run: shell: bash + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - name: Copy testmon cache run: | # branch name may contain slash, we need to replace it with space @@ -83,6 +86,9 @@ jobs: changedLibraryFiles: ${{ steps.find-lib-change.outputs.all_changed_files }} anyLibraryFileChanged: ${{ steps.find-lib-change.outputs.any_changed }} runs-on: ubuntu-latest + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - uses: actions/checkout@v2 with: @@ -140,6 +146,9 @@ jobs: defaults: run: shell: bash + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - name: Checkout TensorNVMe uses: actions/checkout@v2 diff --git a/.github/workflows/compatiblity_test_on_pr.yml b/.github/workflows/compatiblity_test_on_pr.yml index 94a723388..5098b8e36 100644 --- a/.github/workflows/compatiblity_test_on_pr.yml +++ b/.github/workflows/compatiblity_test_on_pr.yml @@ -12,6 +12,9 @@ jobs: runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - uses: actions/checkout@v3 - id: set-matrix @@ -40,6 +43,9 @@ jobs: image: ${{ matrix.container }} options: --gpus all --rm -v /data/scratch/cifar-10:/data/scratch/cifar-10 timeout-minutes: 120 + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - name: Install dependencies run: | diff --git a/.github/workflows/doc_check_on_pr.yml b/.github/workflows/doc_check_on_pr.yml index 992cc93b0..848991bd3 100644 --- a/.github/workflows/doc_check_on_pr.yml +++ b/.github/workflows/doc_check_on_pr.yml @@ -16,6 +16,9 @@ jobs: github.event.pull_request.draft == false && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' runs-on: ubuntu-latest + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - uses: actions/checkout@v2 @@ -31,6 +34,9 @@ jobs: github.event.pull_request.draft == false && github.event.pull_request.base.repo.full_name == 'hpcaitech/ColossalAI' runs-on: ubuntu-latest + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - uses: actions/checkout@v2 with: diff --git a/.github/workflows/doc_test_on_pr.yml b/.github/workflows/doc_test_on_pr.yml index 325e2a7c9..2a07a2297 100644 --- a/.github/workflows/doc_test_on_pr.yml +++ b/.github/workflows/doc_test_on_pr.yml @@ -19,6 +19,9 @@ jobs: outputs: any_changed: ${{ steps.changed-files.outputs.any_changed }} changed_files: ${{ steps.changed-files.outputs.all_changed_files }} + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false name: Detect changed example files steps: - uses: actions/checkout@v3 @@ -59,6 +62,9 @@ jobs: defaults: run: shell: bash + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - name: Checkout ColossalAI-Documentation uses: actions/checkout@v2 diff --git a/.github/workflows/example_check_on_pr.yml b/.github/workflows/example_check_on_pr.yml index 31dbf7540..ee456c25f 100644 --- a/.github/workflows/example_check_on_pr.yml +++ b/.github/workflows/example_check_on_pr.yml @@ -20,6 +20,9 @@ jobs: matrix: ${{ steps.setup-matrix.outputs.matrix }} anyChanged: ${{ steps.setup-matrix.outputs.anyChanged }} name: Detect changed example files + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - uses: actions/checkout@v3 with: @@ -77,6 +80,9 @@ jobs: image: hpcaitech/pytorch-cuda:1.12.0-11.3.0 options: --gpus all --rm -v /data/scratch/examples-data:/data/ timeout-minutes: 10 + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: false steps: - uses: actions/checkout@v3