helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiajunw...@apache.org
Subject [helix] branch master updated: Enhance and simplify the Github Action script.
Date Tue, 20 Apr 2021 23:36:02 GMT
This is an automated email from the ASF dual-hosted git repository.

jiajunwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new 7032f22  Enhance and simplify the Github Action script.
7032f22 is described below

commit 7032f22c7f1b85133038dae4e9c25c8ebff543c2
Author: Jiajun Wang <jjwang@linkedin.com>
AuthorDate: Tue Apr 20 16:27:15 2021 -0700

    Enhance and simplify the Github Action script.
    
    1. Merge or pull request now trigger full CI test.
    2. Only merge code to master will trigger code coverage report to be pushed to code cov.
    3. Attempt to fix the premerge check action.
---
 .github/workflows/Helix-CI.yml                |  9 +++---
 .github/workflows/Helix-PR-CI.yml             | 46 ---------------------------
 .github/workflows/Helix-PR-Premerge-Check.yml | 14 ++++----
 3 files changed, 10 insertions(+), 59 deletions(-)

diff --git a/.github/workflows/Helix-CI.yml b/.github/workflows/Helix-CI.yml
index 99812b5..873bff7 100644
--- a/.github/workflows/Helix-CI.yml
+++ b/.github/workflows/Helix-CI.yml
@@ -1,7 +1,7 @@
-# Run full test for any changes that are merged to master branch.
-
-name: Helix Merge CI
+name: Helix CI
 on:
+  pull_request:
+    branches: [ master ]
   push:
     branches: [ master ]
   schedule:
@@ -22,7 +22,6 @@ jobs:
       run: mvn clean install -Dmaven.test.skip.exec=true
     - name: Run All Tests
       run: mvn -q test
-      if: ${{ success() || failure() }}
     - name: Upload to Codecov
+      if: ${{ github.event_name == 'push' }}
       run: bash <(curl -s https://codecov.io/bash)
-      if: ${{ success() || failure() }}
diff --git a/.github/workflows/Helix-PR-CI.yml b/.github/workflows/Helix-PR-CI.yml
deleted file mode 100644
index 5a0a420..0000000
--- a/.github/workflows/Helix-PR-CI.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-# Run the mininum required tests for pull requests.
-
-name: Helix PR CI
-on:
-  pull_request:
-    branches: [ master ]
-
-jobs:
-  pull_request_CI:
-
-    runs-on: ubuntu-latest
-
-    steps:
-      - uses: actions/checkout@v2
-      - name: Set up JDK 1.8
-        uses: actions/setup-java@v1
-        with:
-          java-version: 1.8
-      - name: Get Changed Files
-        run: |
-          git fetch origin master
-          echo "::set-output name=files::$(git diff --name-only origin/master HEAD)"
-        id: find-diff
-      - name: Build with Maven
-        run: mvn clean install -Dmaven.test.skip.exec=true
-      - name: Test metrics-common
-        run: cd metrics-common; mvn -q test
-        if: ${{ contains(steps.find-diff.outputs.files, 'metrics-common') && (success()
|| failure()) }}
-      - name: Test metadata-store-directory-common
-        run: cd metadata-store-directory-common; mvn -q test
-        if: ${{ contains(steps.find-diff.outputs.files, 'metadata-store-directory-common')
&& (success() || failure()) }}
-      - name: Test zookeeper-api
-        run: cd zookeeper-api; mvn -q test
-        if: ${{ contains(steps.find-diff.outputs.files, 'zookeeper-api') && (success()
|| failure()) }}
-      - name: Test helix-common
-        run: cd helix-common; mvn -q test
-        if: ${{ contains(steps.find-diff.outputs.files, 'helix-common') && (success()
|| failure()) }}
-      - name: Test helix-lock
-        run: cd helix-lock; mvn -q test
-        if: ${{ contains(steps.find-diff.outputs.files, 'helix-lock') && (success()
|| failure()) }}
-      - name: Test helix-rest
-        run: cd helix-rest; mvn -q test
-        if: ${{ contains(steps.find-diff.outputs.files, 'helix-rest') && (success()
|| failure()) }}
-      - name: Test helix-core
-        run: cd helix-core; mvn -q test
-        if: ${{ contains(steps.find-diff.outputs.files, 'helix-core') && (success()
|| failure()) }}
diff --git a/.github/workflows/Helix-PR-Premerge-Check.yml b/.github/workflows/Helix-PR-Premerge-Check.yml
index 3d0ae8f..07fa83f 100644
--- a/.github/workflows/Helix-PR-Premerge-Check.yml
+++ b/.github/workflows/Helix-PR-Premerge-Check.yml
@@ -3,10 +3,8 @@
 name: PR Pre-merge Check
 
 on:
-  pull_request:
-    types: [edited]
-  pull_request_review:
-    types: [submitted]
+  pull_request_target:
+    types: [opened, synchronize, reopened, edited]
 
 jobs:
   validate_PR:
@@ -20,13 +18,13 @@ jobs:
           github-token: ${{secrets.GITHUB_TOKEN}}
           script: |
             const approvalLabel = 'CheckedAndApproved'
-            
+
             const reviews = await github.pulls.listReviews({
               pull_number: context.payload.pull_request.number,
               owner: context.repo.owner,
               repo: context.repo.repo
             })
-            
+
             // Check if any recent APPROVED or CHANGES_REQUESTED reviews.
             var approved = false
             for (const review_info of reviews.data) {
@@ -39,7 +37,7 @@ jobs:
                 approved = false
               }
             }
-            
+
             if (approved) {
               console.log("This PR has been approved.")
               github.issues.addLabels({
@@ -55,7 +53,7 @@ jobs:
                 owner: context.repo.owner,
                 repo: context.repo.repo
               })
-              
+
               var approvalLabelExist = false
               for (const label of labels_info.data) {
                 if (label.name == approvalLabel) {

Mime
View raw message