diff --git a/.github/changes-filter.yaml b/.github/changes-filter.yaml index 0f01fb2caadfd..b14153acb8242 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 04b048467bbe0..d9ee7b15637f8 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 5ff251654da09..0efc4d2ca2c7b 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 9fe7f83020dc1..f008b2383abf5 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 @@ -161,22 +164,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: | @@ -188,28 +191,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 }} @@ -218,18 +221,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 @@ -237,7 +240,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 @@ -245,7 +248,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 @@ -269,22 +272,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: | @@ -296,23 +299,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 \ @@ -320,7 +323,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 @@ -374,22 +377,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: | @@ -401,40 +404,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 }} @@ -443,18 +446,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 @@ -462,7 +465,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 @@ -470,7 +473,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 @@ -493,7 +496,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