| # |
| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| # |
| |
| name: Pulsar CI |
| on: |
| pull_request: |
| branches: |
| - master |
| push: |
| branches: |
| - branch-* |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }} |
| cancel-in-progress: true |
| |
| env: |
| MAVEN_OPTS: -Xmx1024m -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 |
| # defines the retention period for the intermediate build artifacts needed for rerunning a failed build job |
| # it's possible to rerun individual failed jobs when the build artifacts are available |
| # if the artifacts have already been expired, the complete workflow can be rerun by closing and reopening the PR or by rebasing the PR |
| ARTIFACT_RETENTION_DAYS: 3 |
| |
| jobs: |
| changed_files_job: |
| name: 'Changed files check' |
| 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 |
| uses: actions/checkout@v2 |
| |
| - name: Detect changed files |
| id: changes |
| uses: apache/pulsar-test-infra/paths-filter@master |
| with: |
| filters: .github/changes-filter.yaml |
| list-files: csv |
| |
| - 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 }}" |
| 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 |
| name: Build and License check |
| runs-on: ubuntu-20.04 |
| timeout-minutes: 60 |
| |
| steps: |
| - name: checkout |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: actions/checkout@v2 |
| |
| - name: Tune Runner VM |
| if: ${{ needs.changed_files_job.outputs.docs_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' }} |
| uses: ./.github/actions/ssh-access |
| with: |
| limit-access-to-actor: true |
| |
| - name: Cache local Maven repository |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/*/*/* |
| !~/.m2/repository/org/apache/pulsar |
| key: ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-m2-dependencies-core-modules- |
| |
| - name: Set up JDK 17 |
| uses: actions/setup-java@v2 |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| with: |
| distribution: 'temurin' |
| java-version: 17 |
| |
| - name: Check source code license headers |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: mvn -B -T 8 -ntp initialize apache-rat:check license:check |
| |
| - name: Build core-modules |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: | |
| mvn -B -T 1C -ntp -Pcore-modules,-main clean install -DskipTests -Dlicense.skip=true -Drat.skip=true |
| |
| - name: Check binary licenses |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: src/check-binary-license.sh ./distribution/server/target/apache-pulsar-*-bin.tar.gz |
| |
| - name: Install gh-actions-artifact-client.js |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master |
| |
| - name: Save maven build results to Github artifact cache so that the results can be reused |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: | |
| cd $HOME |
| $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh store_tar_to_github_actions_artifacts pulsar-maven-repository-binaries \ |
| tar --exclude '.m2/repository/org/apache/pulsar/pulsar-*-distribution' \ |
| -I zstd -cf - .m2/repository/org/apache/pulsar |
| |
| - name: Wait for ssh connection when build fails |
| # ssh access is enabled for builds in own forks |
| uses: ./.github/actions/ssh-access |
| if: ${{ failure() && github.repository != 'apache/pulsar' }} |
| continue-on-error: true |
| with: |
| action: wait |
| |
| unit-tests: |
| name: CI - Unit - ${{ matrix.name }} |
| runs-on: ubuntu-20.04 |
| timeout-minutes: ${{ matrix.timeout || 60 }} |
| needs: ['changed_files_job', 'build-and-license-check'] |
| strategy: |
| fail-fast: false |
| matrix: |
| include: |
| - name: Other |
| group: OTHER |
| timeout: 75 |
| - name: Brokers - Broker Group 1 |
| group: BROKER_GROUP_1 |
| - name: Brokers - Broker Group 2 |
| group: BROKER_GROUP_2 |
| - name: Brokers - Broker Group 3 |
| group: BROKER_GROUP_3 |
| - name: Brokers - Client Api |
| group: BROKER_CLIENT_API |
| - name: Brokers - Client Impl |
| group: BROKER_CLIENT_IMPL |
| - name: Brokers - Flaky |
| group: BROKER_FLAKY |
| timeout: 75 |
| - name: Proxy |
| group: PROXY |
| - name: Pulsar IO |
| group: PULSAR_IO |
| |
| steps: |
| - name: checkout |
| 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' && 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' && 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' && needs.changed_files_job.outputs.cpp_only != 'true' }} |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/*/*/* |
| !~/.m2/repository/org/apache/pulsar |
| key: ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-m2-dependencies-core-modules- |
| |
| - name: Set up JDK ${{ matrix.jdk || '17' }} |
| uses: actions/setup-java@v2 |
| 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' && 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' && 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' && 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' && 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 }} |
| |
| - name: print JVM thread dumps when cancelled |
| if: cancelled() |
| 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' && 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' && 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' && needs.changed_files_job.outputs.cpp_only != 'true' }} |
| with: |
| name: Unit-${{ matrix.group }}-test-report |
| path: test-reports |
| retention-days: 7 |
| |
| - name: Upload Surefire reports |
| uses: actions/upload-artifact@v3 |
| 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 |
| retention-days: 7 |
| |
| - name: Upload possible heap dump |
| uses: actions/upload-artifact@v3 |
| 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 |
| retention-days: 7 |
| if-no-files-found: ignore |
| |
| - name: Wait for ssh connection when build fails |
| # ssh access is enabled for builds in own forks |
| uses: ./.github/actions/ssh-access |
| if: ${{ failure() && github.repository != 'apache/pulsar' }} |
| continue-on-error: true |
| with: |
| action: wait |
| |
| pulsar-java-test-image: |
| name: Build Pulsar java-test-image docker image |
| runs-on: ubuntu-20.04 |
| timeout-minutes: 60 |
| needs: ['changed_files_job', 'build-and-license-check'] |
| env: |
| UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/ |
| steps: |
| - name: checkout |
| 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' && 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' && 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' && needs.changed_files_job.outputs.cpp_only != 'true' }} |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/*/*/* |
| !~/.m2/repository/org/apache/pulsar |
| key: ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-m2-dependencies-core-modules- |
| |
| - name: Set up JDK 17 |
| uses: actions/setup-java@v2 |
| 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' && 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' && 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' && 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 \ |
| -Dmaven.test.skip=true -Ddockerfile.build.squash=true -DskipSourceReleaseAssembly=true \ |
| -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' && 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 |
| |
| - name: Wait for ssh connection when build fails |
| # ssh access is enabled for builds in own forks |
| uses: ./.github/actions/ssh-access |
| if: ${{ failure() && github.repository != 'apache/pulsar' }} |
| continue-on-error: true |
| with: |
| action: wait |
| |
| integration-tests: |
| name: CI - Integration - ${{ matrix.name }} |
| runs-on: ubuntu-20.04 |
| timeout-minutes: ${{ matrix.timeout || 60 }} |
| needs: ['changed_files_job', 'pulsar-java-test-image'] |
| env: |
| PULSAR_TEST_IMAGE_NAME: apachepulsar/java-test-image:latest |
| strategy: |
| fail-fast: false |
| matrix: |
| include: |
| - name: Backwards Compatibility |
| group: BACKWARDS_COMPAT |
| |
| - name: Cli |
| group: CLI |
| |
| - name: Messaging |
| group: MESSAGING |
| |
| - name: Shade on Java 8 |
| group: SHADE_RUN |
| runtime_jdk: 8 |
| setup: ./build/run_integration_group.sh SHADE_BUILD |
| |
| - name: Shade on Java 11 |
| group: SHADE_RUN |
| runtime_jdk: 11 |
| setup: ./build/run_integration_group.sh SHADE_BUILD |
| |
| - name: Shade on Java 17 |
| group: SHADE_RUN |
| setup: ./build/run_integration_group.sh SHADE_BUILD |
| |
| - name: Standalone |
| group: STANDALONE |
| |
| - name: Transaction |
| group: TRANSACTION |
| |
| steps: |
| - name: checkout |
| 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' && 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' && 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' && needs.changed_files_job.outputs.cpp_only != 'true' }} |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/*/*/* |
| !~/.m2/repository/org/apache/pulsar |
| key: ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-m2-dependencies-core-modules- |
| |
| - name: Set up JDK 17 |
| uses: actions/setup-java@v2 |
| 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' && 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' && 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' && 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' && 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' && 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' && needs.changed_files_job.outputs.cpp_only != 'true' }} |
| run: | |
| ./build/run_integration_group.sh ${{ matrix.group }} |
| |
| - name: print JVM thread dumps when cancelled |
| if: cancelled() |
| 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' && 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' && 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' && needs.changed_files_job.outputs.cpp_only != 'true' }} |
| with: |
| name: Integration-${{ matrix.group }}-test-report |
| path: test-reports |
| retention-days: 7 |
| |
| - name: Upload Surefire reports |
| uses: actions/upload-artifact@v3 |
| 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 |
| retention-days: 7 |
| |
| - name: Upload container logs |
| uses: actions/upload-artifact@v3 |
| 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 |
| path: tests/integration/target/container-logs |
| retention-days: 7 |
| |
| - name: Wait for ssh connection when build fails |
| # ssh access is enabled for builds in own forks |
| uses: ./.github/actions/ssh-access |
| if: ${{ failure() && github.repository != 'apache/pulsar' }} |
| continue-on-error: true |
| with: |
| action: wait |
| |
| delete-integration-test-docker-image-artifact: |
| name: "Delete integration test docker image artifact" |
| runs-on: ubuntu-20.04 |
| timeout-minutes: 10 |
| needs: [ |
| 'changed_files_job', |
| 'integration-tests' |
| ] |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} |
| steps: |
| - name: checkout |
| uses: actions/checkout@v2 |
| |
| - name: Tune Runner VM |
| uses: ./.github/actions/tune-runner-vm |
| |
| - name: Install gh-actions-artifact-client.js |
| uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master |
| |
| - name: Delete docker image from GitHub Actions Artifacts |
| run: | |
| gh-actions-artifact-client.js delete pulsar-java-test-image.zst |
| |
| pulsar-test-latest-version-image: |
| name: Build Pulsar docker image |
| runs-on: ubuntu-20.04 |
| timeout-minutes: 60 |
| needs: ['changed_files_job', 'build-and-license-check'] |
| env: |
| UBUNTU_MIRROR: http://azure.archive.ubuntu.com/ubuntu/ |
| steps: |
| - name: checkout |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: actions/checkout@v2 |
| |
| - name: Tune Runner VM |
| if: ${{ needs.changed_files_job.outputs.docs_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' }} |
| uses: ./.github/actions/ssh-access |
| with: |
| limit-access-to-actor: true |
| |
| - name: Clean Disk |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: ./.github/actions/clean-disk |
| |
| - name: Cache local Maven repository |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/*/*/* |
| !~/.m2/repository/org/apache/pulsar |
| key: ${{ runner.os }}-m2-dependencies-all-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} |
| ${{ runner.os }}-m2-dependencies-core-modules- |
| |
| - name: Set up JDK 17 |
| uses: actions/setup-java@v2 |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| with: |
| distribution: 'temurin' |
| java-version: 17 |
| |
| - name: Install gh-actions-artifact-client.js |
| if: ${{ needs.changed_files_job.outputs.docs_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' }} |
| run: | |
| cd $HOME |
| $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh restore_tar_from_github_actions_artifacts pulsar-maven-repository-binaries |
| |
| - name: Build latest-version-image docker image |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: | |
| # build docker image |
| # include building of Pulsar SQL, Connectors, Offloaders and server distros |
| mvn -B -am -pl pulsar-sql/presto-distribution,distribution/io,distribution/offloaders,distribution/server,tests/docker-images/latest-version-image install \ |
| -Pmain,docker -Dmaven.test.skip=true -Ddockerfile.build.squash=true \ |
| -Dspotbugs.skip=true -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=true |
| |
| - name: save docker image apachepulsar/pulsar-test-latest-version:latest to Github artifact cache |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: | |
| $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh docker_save_image_to_github_actions_artifacts apachepulsar/pulsar-test-latest-version:latest pulsar-test-latest-version-image |
| |
| - name: Wait for ssh connection when build fails |
| # ssh access is enabled for builds in own forks |
| uses: ./.github/actions/ssh-access |
| if: ${{ failure() && github.repository != 'apache/pulsar' }} |
| continue-on-error: true |
| with: |
| action: wait |
| |
| system-tests: |
| name: CI - System - ${{ matrix.name }} |
| runs-on: ubuntu-20.04 |
| timeout-minutes: 60 |
| needs: ['changed_files_job', 'pulsar-test-latest-version-image'] |
| env: |
| PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest |
| strategy: |
| fail-fast: false |
| matrix: |
| include: |
| - name: Tiered FileSystem |
| group: TIERED_FILESYSTEM |
| |
| - name: Tiered JCloud |
| group: TIERED_JCLOUD |
| |
| - name: Function |
| group: FUNCTION |
| |
| - name: Schema |
| group: SCHEMA |
| |
| - name: Pulsar Connectors - Thread |
| group: PULSAR_CONNECTORS_THREAD |
| |
| - name: Pulsar Connectors - Process |
| group: PULSAR_CONNECTORS_PROCESS |
| |
| - name: Pulsar IO |
| group: PULSAR_IO |
| |
| - name: Pulsar IO - Oracle |
| group: PULSAR_IO_ORA |
| |
| - name: Sql |
| group: SQL |
| |
| steps: |
| - name: checkout |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: actions/checkout@v2 |
| |
| - name: Tune Runner VM |
| if: ${{ needs.changed_files_job.outputs.docs_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' }} |
| uses: ./.github/actions/ssh-access |
| with: |
| limit-access-to-actor: true |
| |
| - name: Cache local Maven repository |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: actions/cache@v2 |
| with: |
| path: | |
| ~/.m2/repository/*/*/* |
| !~/.m2/repository/org/apache/pulsar |
| key: ${{ runner.os }}-m2-dependencies-all-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-m2-dependencies-core-modules-${{ hashFiles('**/pom.xml') }} |
| ${{ runner.os }}-m2-dependencies-core-modules- |
| |
| - name: Set up JDK 17 |
| uses: actions/setup-java@v2 |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| with: |
| distribution: 'temurin' |
| java-version: 17 |
| |
| - name: Install gh-actions-artifact-client.js |
| if: ${{ needs.changed_files_job.outputs.docs_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' }} |
| 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/pulsar-test-latest-version:latest from Github artifact cache |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: | |
| $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh docker_load_image_from_github_actions_artifacts pulsar-test-latest-version-image |
| |
| - name: Run setup commands |
| if: ${{ matrix.setup && needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: | |
| ${{ matrix.setup }} |
| |
| - name: Run system test group '${{ matrix.group }}' |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| run: | |
| ./build/run_integration_group.sh ${{ matrix.group }} |
| |
| - name: print JVM thread dumps when cancelled |
| if: cancelled() |
| 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' }} |
| uses: ./.github/actions/copy-test-reports |
| |
| - name: Report test summary as warning |
| if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }} |
| uses: ./.github/actions/merge-test-reports |
| with: |
| summary_title: 'Test Summary for System - ${{ 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' }} |
| with: |
| name: System-${{ matrix.group }}-test-report |
| path: test-reports |
| retention-days: 7 |
| |
| - name: Upload container logs |
| uses: actions/upload-artifact@v3 |
| if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' }} |
| continue-on-error: true |
| with: |
| name: System-${{ matrix.group }}-container-logs |
| path: tests/integration/target/container-logs |
| retention-days: 7 |
| |
| - name: Upload Surefire reports |
| uses: actions/upload-artifact@v3 |
| if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' }} |
| with: |
| name: System-${{ matrix.name }}-surefire-reports |
| path: surefire-reports |
| retention-days: 7 |
| |
| - name: Wait for ssh connection when build fails |
| # ssh access is enabled for builds in own forks |
| uses: ./.github/actions/ssh-access |
| if: ${{ failure() && github.repository != 'apache/pulsar' }} |
| continue-on-error: true |
| with: |
| action: wait |
| |
| delete-system-test-docker-image-artifact: |
| name: "Delete system test docker image artifact" |
| runs-on: ubuntu-20.04 |
| timeout-minutes: 10 |
| needs: [ |
| 'changed_files_job', |
| 'system-tests' |
| ] |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| steps: |
| - name: checkout |
| uses: actions/checkout@v2 |
| |
| - name: Tune Runner VM |
| uses: ./.github/actions/tune-runner-vm |
| |
| - name: Install gh-actions-artifact-client.js |
| uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master |
| |
| - name: Delete docker image from GitHub Actions Artifacts |
| run: | |
| gh-actions-artifact-client.js delete pulsar-test-latest-version-image.zst |
| |
| delete-pulsar-build-binaries-artifact: |
| name: "Delete pulsar-maven-repository-binaries.tar.zst artifact" |
| runs-on: ubuntu-20.04 |
| timeout-minutes: 10 |
| needs: [ |
| 'changed_files_job', |
| 'unit-tests', |
| 'integration-tests', |
| 'system-tests' |
| ] |
| if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} |
| steps: |
| - name: checkout |
| uses: actions/checkout@v2 |
| |
| - name: Tune Runner VM |
| uses: ./.github/actions/tune-runner-vm |
| |
| - name: Install gh-actions-artifact-client.js |
| uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master |
| |
| - name: Delete maven repository binaries from GitHub Actions Artifacts |
| run: | |
| gh-actions-artifact-client.js delete pulsar-maven-repository-binaries.tar.zst |