sandynz commented on pull request #14843:
URL: https://github.com/apache/shardingsphere/pull/14843#issuecomment-1016014150


   Since there're some questions on the effect, so I paln to add some 
explanation and example here.
   
   Trigger in `ci.yml` (Continuous Integration) and `it.yml` (Integration Test):
   ```
   on:
     push:
       branches: [ master, dev ]
     pull_request:
       branches: [ master ]
   ```
   
   All workflows are triggered by these webhook payload:
   1. When `pull_request` opened, synchronize, or reopened. Refer to 
[events-that-trigger-workflows#pull_request]( 
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
 ) for more details.
   2. When `push` to `master` branch, it'll occur when merging PR into master 
branch. Refer to [events-that-trigger-workflows#push]( 
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
 ) for more details.
   
   All of these scenarios are improved.
   
   1, Scenario 1: `pull_request` triggered workflow
   
   Workflows triggered by `pull_request` are isolated by PR number (via 
concurrency group). Effects:
   - When PR2 is opened, it will **NOT** cancel PR1's workflow
   - In every PR, e.g. PR2, if there're more commit and push after PR opened, 
then it'll cancel previous workflow. e.g. in PR 14776,  after I commit 06fafd6 
and push it, I commit 85cce8b  and push it immediately, 06fafd6 triggered 
workflow is cancelled, screenshot:
   <img width="918" alt="图片" 
src="https://user-images.githubusercontent.com/42492540/150049303-2bc87e24-34fc-4762-9760-2ea29ffe2700.png";>
   
   2, Scenario 2: `push` triggered workflow
   
   Workflows triggered by `push` are isolated by branch (via concurrency 
gruop). Effect:
   - If several PRs are merged quickly, e.g. PR1, PR2, PR3, then 1) when PR2 
merged, PR1 push triggered workflow will be cancelled, 2) when PR3 merged, PR2 
push triggered workflow will be cancelled, 3) current active workflow is PR3 
push triggered. Example in [actions filter by push]( 
https://github.com/apache/shardingsphere/actions?query=event%3Apush ), 
screenshot:
   <img width="941" alt="图片" 
src="https://user-images.githubusercontent.com/42492540/150050411-caefa049-11a9-450d-b5f6-f88992e384cf.png";>
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to