You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by xy...@apache.org on 2022/08/11 03:02:42 UTC

[pulsar] branch master updated: [improve][ci] Skip other tests when there are only cpp/python related changes (#16988)

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 5cdb5911e3c [improve][ci] Skip other tests when there are only cpp/python related changes (#16988)
5cdb5911e3c is described below

commit 5cdb5911e3c702313e53fce9c4e8cf9a148ff795
Author: Zike Yang <zi...@apache.org>
AuthorDate: Thu Aug 11 11:02:37 2022 +0800

    [improve][ci] Skip other tests when there are only cpp/python related changes (#16988)
---
 .github/changes-filter.yaml                  |  2 +
 .github/workflows/ci-go-functions-style.yaml | 12 ++--
 .github/workflows/ci-go-functions-test.yaml  |  8 ++-
 .github/workflows/pulsar-ci.yaml             | 85 ++++++++++++++--------------
 4 files changed, 58 insertions(+), 49 deletions(-)

diff --git a/.github/changes-filter.yaml b/.github/changes-filter.yaml
index 0f01fb2caad..b14153acb82 100644
--- a/.github/changes-filter.yaml
+++ b/.github/changes-filter.yaml
@@ -10,3 +10,5 @@ docs:
   - '**/*.md'
 tests:
   - added|modified: '**/src/test/java/**/*.java'
+cpp:
+  - 'pulsar-client-cpp/**'
diff --git a/.github/workflows/ci-go-functions-style.yaml b/.github/workflows/ci-go-functions-style.yaml
index 04b048467bb..d9ee7b15637 100644
--- a/.github/workflows/ci-go-functions-style.yaml
+++ b/.github/workflows/ci-go-functions-style.yaml
@@ -64,31 +64,33 @@ jobs:
 
       - name: Check changed files
         id: check_changes
-        run: echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
+        run: |
+          echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
+          echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
 
       - name: Set up Go
         uses: actions/setup-go@v2
-        if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
+        if: ${{ steps.check_changes.outputs.docs_only != 'true' && steps.check_changes.outputs.cpp_only != 'true' }}
         with:
           go-version: ${{ matrix.go-version }}
         id: go
 
       - name: InstallTool
-        if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
+        if: ${{ steps.check_changes.outputs.docs_only != 'true' && steps.check_changes.outputs.cpp_only != 'true' }}
         run: |
           cd pulsar-function-go
           wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.18.0
           ./bin/golangci-lint --version
 
       - name: Build
-        if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
+        if: ${{ steps.check_changes.outputs.docs_only != 'true' && steps.check_changes.outputs.cpp_only != 'true' }}
         run: |
           cd pulsar-function-go
           export GO111MODULE=on
           go build ./...
 
       - name: CheckStyle
-        if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
+        if: ${{ steps.check_changes.outputs.docs_only != 'true' && steps.check_changes.outputs.cpp_only != 'true' }}
         run: |
           cd pulsar-function-go
           export GO111MODULE=on
diff --git a/.github/workflows/ci-go-functions-test.yaml b/.github/workflows/ci-go-functions-test.yaml
index 5ff251654da..0efc4d2ca2c 100644
--- a/.github/workflows/ci-go-functions-test.yaml
+++ b/.github/workflows/ci-go-functions-test.yaml
@@ -66,17 +66,19 @@ jobs:
 
       - name: Check changed files
         id: check_changes
-        run: echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
+        run: |
+          echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
+          echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
 
       - name: Set up Go
         uses: actions/setup-go@v2
-        if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
+        if: ${{ steps.check_changes.outputs.docs_only != 'true' && steps.check_changes.outputs.cpp_only != 'true' }}
         with:
           go-version: ${{ matrix.go-version }}
         id: go
 
       - name: Run tests
-        if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
+        if: ${{ steps.check_changes.outputs.docs_only != 'true' && steps.check_changes.outputs.cpp_only != 'true' }}
         run: |
           cd pulsar-function-go
           export GO111MODULE=on
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index a551b836db8..881d8b50d0c 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -43,6 +43,7 @@ jobs:
     runs-on: ubuntu-20.04
     outputs:
       docs_only: ${{ steps.check_changes.outputs.docs_only }}
+      cpp_only: ${{ steps.check_changes.outputs.cpp_only }}
       changed_tests: ${{ steps.changes.outputs.tests_files }}
     steps:
       - name: checkout
@@ -57,7 +58,9 @@ jobs:
 
       - name: Check changed files
         id: check_changes
-        run: echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
+        run: |
+          echo "::set-output name=docs_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.docs_count) && fromJSON(steps.changes.outputs.docs_count) > 0 }}"
+          echo "::set-output name=cpp_only::${{ fromJSON(steps.changes.outputs.all_count) == fromJSON(steps.changes.outputs.cpp_count) && fromJSON(steps.changes.outputs.cpp_count) > 0 }}"
 
   build-and-license-check:
     needs: changed_files_job
@@ -164,22 +167,22 @@ jobs:
 
     steps:
       - name: checkout
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: actions/checkout@v2
 
       - name: Tune Runner VM
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/tune-runner-vm
 
       - name: Setup ssh access to build runner VM
         # ssh access is enabled for builds in own forks
-        if: ${{ github.repository != 'apache/pulsar' && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ github.repository != 'apache/pulsar' && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/ssh-access
         with:
           limit-access-to-actor: true
 
       - name: Cache Maven dependencies
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: actions/cache@v2
         with:
           path: |
@@ -191,28 +194,28 @@ jobs:
 
       - name: Set up JDK ${{ matrix.jdk || '17' }}
         uses: actions/setup-java@v2
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           distribution: 'temurin'
           java-version: ${{ matrix.jdk || '17' }}
 
       - name: Install gh-actions-artifact-client.js
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
 
       - name: Restore maven build results from Github artifact cache
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           cd $HOME
           $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh restore_tar_from_github_actions_artifacts pulsar-maven-repository-binaries
 
       - name: Run setup commands
-        if: ${{ matrix.setup && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ matrix.setup && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           ${{ matrix.setup }}
 
       - name: Run unit test group '${{ matrix.group }}'
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           CHANGED_TESTS="${{ needs.changed_files_job.outputs.tests_files }}" ./build/run_unit_group.sh ${{ matrix.group }}
 
@@ -221,18 +224,18 @@ jobs:
         run: $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh print_thread_dumps
 
       - name: Aggregates all test reports to ./test-reports and ./surefire-reports directories
-        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/copy-test-reports
 
       - name: Report test summary as warning
-        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/merge-test-reports
         with:
           summary_title: 'Test Summary for Unit - ${{ matrix.name }}:'
 
       - name: Publish the Test reports in Junit xml format
         uses: actions/upload-artifact@v3
-        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           name: Unit-${{ matrix.group }}-test-report
           path: test-reports
@@ -240,7 +243,7 @@ jobs:
 
       - name: Upload Surefire reports
         uses: actions/upload-artifact@v3
-        if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           name: Unit-${{ matrix.group }}-surefire-reports
           path: surefire-reports
@@ -248,7 +251,7 @@ jobs:
 
       - name: Upload possible heap dump
         uses: actions/upload-artifact@v3
-        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           name: Unit-${{ matrix.group }}-heapdump
           path: /tmp/*.hprof
@@ -272,22 +275,22 @@ jobs:
       UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/
     steps:
       - name: checkout
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: actions/checkout@v2
 
       - name: Tune Runner VM
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/tune-runner-vm
 
       - name: Setup ssh access to build runner VM
         # ssh access is enabled for builds in own forks
-        if: ${{ github.repository != 'apache/pulsar' && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ github.repository != 'apache/pulsar' && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/ssh-access
         with:
           limit-access-to-actor: true
 
       - name: Cache Maven dependencies
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: actions/cache@v2
         with:
           path: |
@@ -299,23 +302,23 @@ jobs:
 
       - name: Set up JDK 17
         uses: actions/setup-java@v2
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           distribution: 'temurin'
           java-version: 17
 
       - name: Install gh-actions-artifact-client.js
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
 
       - name: restore maven build results from Github artifact cache
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           cd $HOME
           $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh restore_tar_from_github_actions_artifacts pulsar-maven-repository-binaries
 
       - name: Build java-test-image docker image
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           # build docker image
           mvn -B -am -pl tests/docker-images/java-test-image install -Pcore-modules,-main,integrationTests,docker \
@@ -323,7 +326,7 @@ jobs:
           -Dspotbugs.skip=true  -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=true
 
       - name: save docker image apachepulsar/java-test-image:latest to Github artifact cache
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh docker_save_image_to_github_actions_artifacts apachepulsar/java-test-image:latest pulsar-java-test-image
 
@@ -377,22 +380,22 @@ jobs:
 
     steps:
       - name: checkout
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: actions/checkout@v2
 
       - name: Tune Runner VM
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/tune-runner-vm
 
       - name: Setup ssh access to build runner VM
         # ssh access is enabled for builds in own forks
-        if: ${{ github.repository != 'apache/pulsar' && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ github.repository != 'apache/pulsar' && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/ssh-access
         with:
           limit-access-to-actor: true
 
       - name: Cache Maven dependencies
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: actions/cache@v2
         with:
           path: |
@@ -404,40 +407,40 @@ jobs:
 
       - name: Set up JDK 17
         uses: actions/setup-java@v2
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           distribution: 'temurin'
           java-version: 17
 
       - name: Install gh-actions-artifact-client.js
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
 
       - name: Restore maven build results from Github artifact cache
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           cd $HOME
           $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh restore_tar_from_github_actions_artifacts pulsar-maven-repository-binaries
 
       - name: Load docker image apachepulsar/java-test-image:latest from Github artifact cache
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh docker_load_image_from_github_actions_artifacts pulsar-java-test-image
 
       - name: Run setup commands
-        if: ${{ matrix.setup && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ matrix.setup && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           ${{ matrix.setup }}
 
       - name: Set up runtime JDK ${{ matrix.runtime_jdk }}
         uses: actions/setup-java@v2
-        if: ${{ matrix.runtime_jdk && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ matrix.runtime_jdk && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           distribution: 'temurin'
           java-version: ${{ matrix.runtime_jdk }}
 
       - name: Run integration test group '${{ matrix.group }}'
-        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         run: |
           ./build/run_integration_group.sh ${{ matrix.group }}
 
@@ -446,18 +449,18 @@ jobs:
         run: $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh print_thread_dumps
 
       - name: Aggregates all test reports to ./test-reports and ./surefire-reports directories
-        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/copy-test-reports
 
       - name: Report test summary as warning
-        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         uses: ./.github/actions/merge-test-reports
         with:
           summary_title: 'Test Summary for Integration - ${{ matrix.name }}:'
 
       - name: Publish the Test reports in Junit xml format
         uses: actions/upload-artifact@v3
-        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           name: Integration-${{ matrix.group }}-test-report
           path: test-reports
@@ -465,7 +468,7 @@ jobs:
 
       - name: Upload Surefire reports
         uses: actions/upload-artifact@v3
-        if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         with:
           name: Integration-${{ matrix.group }}-surefire-reports
           path: surefire-reports
@@ -473,7 +476,7 @@ jobs:
 
       - name: Upload container logs
         uses: actions/upload-artifact@v3
-        if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' }}
+        if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
         continue-on-error: true
         with:
           name: Integration-${{ matrix.group }}-container-logs
@@ -496,7 +499,7 @@ jobs:
       'changed_files_job',
       'integration-tests'
     ]
-    if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }}
+    if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }}
     steps:
       - name: checkout
         uses: actions/checkout@v2