From 6b04f6f3aeba57a9889ffdf0636ea3c51014da6a Mon Sep 17 00:00:00 2001 From: Sijie Guo Date: Fri, 31 Jan 2020 23:35:56 -0800 Subject: [PATCH] Skip tests if a pull request only changes documentation (#6182) Motivation Currently github actions are marked as required. But github actions are skipped if the change only changes markdown files. So it is blocking merging documentation changes. Modification Add a github action to check if this pull request is a doc-only change or not. If it is a doc-only change, we can skip the checks. * Skip tests if a pull requests only change the docs * Change the workflows to run only when there are code changes * add conditional check to ci-integration-process --- .github/workflows/ci-cpp.yaml | 20 ++++++++++---- .github/workflows/ci-go-functions-style.yaml | 16 +++++++++--- .github/workflows/ci-go-functions-test.yaml | 15 ++++++++--- ...i-integration-backwards-compatibility.yaml | 22 ++++++++++++---- .github/workflows/ci-integration-cli.yaml | 18 +++++++++---- .../ci-integration-function-state.yaml | 18 +++++++++---- .../workflows/ci-integration-messaging.yaml | 18 +++++++++---- .github/workflows/ci-integration-process.yaml | 24 +++++++++++++---- .github/workflows/ci-integration-schema.yaml | 18 +++++++++---- .github/workflows/ci-integration-sql.yaml | 19 ++++++++++---- .../workflows/ci-integration-standalone.yaml | 18 +++++++++---- .github/workflows/ci-integration-thread.yaml | 24 +++++++++++++---- .../ci-integration-tiered-filesystem.yaml | 18 +++++++++---- .../ci-integration-tiered-jcloud.yaml | 18 +++++++++---- .github/workflows/ci-license.yaml | 19 ++++++++++---- .github/workflows/ci-unit-adaptors.yml | 20 ++++++++++---- .github/workflows/ci-unit-broker-sasl.yml | 19 ++++++++++---- .github/workflows/ci-unit-broker.yml | 26 +++++++++++++++---- .github/workflows/ci-unit-flaky.yaml | 22 ++++++++++++---- .github/workflows/ci-unit-proxy.yaml | 20 ++++++++++---- .github/workflows/ci-unit.yaml | 19 ++++++++++---- 21 files changed, 310 insertions(+), 101 deletions(-) diff --git a/.github/workflows/ci-cpp.yaml b/.github/workflows/ci-cpp.yaml index d7d746adbb828..3badb036f7e02 100644 --- a/.github/workflows/ci-cpp.yaml +++ b/.github/workflows/ci-cpp.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,24 +31,36 @@ jobs: timeout-minutes: 120 steps: + + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build pacakge + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR package -DskipTests - name: build cpp artifacts + if: steps.docs.outputs.changed_only == 'no' run: | echo "Build C++ client library" export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug -DBUILD_DYNAMIC_LIB=OFF" pulsar-client-cpp/docker-build.sh - name: run c++ tests + if: steps.docs.outputs.changed_only == 'no' run: pulsar-client-cpp/docker-tests.sh diff --git a/.github/workflows/ci-go-functions-style.yaml b/.github/workflows/ci-go-functions-style.yaml index cf30e520cfe42..6502c3ffba9d2 100644 --- a/.github/workflows/ci-go-functions-style.yaml +++ b/.github/workflows/ci-go-functions-style.yaml @@ -31,28 +31,38 @@ jobs: name: Build runs-on: ubuntu-latest steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment - name: Set up Go 1.12 uses: actions/setup-go@v1 + if: steps.docs.outputs.changed_only == 'no' with: go-version: 1.12 id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v1 - - name: InstallTool + if: steps.docs.outputs.changed_only == 'no' 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.docs.outputs.changed_only == 'no' run: | cd pulsar-function-go go build ./pf - name: CheckStyle + if: steps.docs.outputs.changed_only == 'no' run: | cd pulsar-function-go ./bin/golangci-lint run -c ./golangci.yml ./pf diff --git a/.github/workflows/ci-go-functions-test.yaml b/.github/workflows/ci-go-functions-test.yaml index 059499c1f085e..58ec4ea836128 100644 --- a/.github/workflows/ci-go-functions-test.yaml +++ b/.github/workflows/ci-go-functions-test.yaml @@ -34,16 +34,25 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up Go 1.12 uses: actions/setup-go@v1 + if: steps.docs.outputs.changed_only == 'no' with: go-version: 1.12 id: go - - name: checkout - uses: actions/checkout@v1 - - name: run tests + if: steps.docs.outputs.changed_only == 'no' run: | cd pulsar-function-go go test -v $(go list ./... | grep -v examples) diff --git a/.github/workflows/ci-integration-backwards-compatibility.yaml b/.github/workflows/ci-integration-backwards-compatibility.yaml index 47fc5f6215f61..0488801d4349b 100644 --- a/.github/workflows/ci-integration-backwards-compatibility.yaml +++ b/.github/workflows/ci-integration-backwards-compatibility.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,28 +31,42 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 + if: steps.docs.outputs.changed_only == 'no' uses: actions/setup-java@v1 with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: run install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/docker-images/pom.xml install -am -Pdocker -DskipTests - name: clean docker container + if: steps.docs.outputs.changed_only == 'no' run: docker system prune -f - name: remove docker node image + if: steps.docs.outputs.changed_only == 'no' run: docker rmi -f node:10 && docker rmi -f node:12 && docker rmi -f buildpack-deps:stretch - name: remove docker builder and microsoft image + if: steps.docs.outputs.changed_only == 'no' run: docker rmi -f jekyll/builder:latest && docker rmi -f mcr.microsoft.com/azure-pipelines/node8-typescript:latest - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-backwards-compatibility.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-cli.yaml b/.github/workflows/ci-integration-cli.yaml index 7e07789426170..e935df64ca4d8 100644 --- a/.github/workflows/ci-integration-cli.yaml +++ b/.github/workflows/ci-integration-cli.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,16 +31,26 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-cli.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-function-state.yaml b/.github/workflows/ci-integration-function-state.yaml index 51a44451c07b7..993c1ef84d341 100644 --- a/.github/workflows/ci-integration-function-state.yaml +++ b/.github/workflows/ci-integration-function-state.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,16 +31,26 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-function-state.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-messaging.yaml b/.github/workflows/ci-integration-messaging.yaml index 6c008931db90d..776842ab2e0b4 100644 --- a/.github/workflows/ci-integration-messaging.yaml +++ b/.github/workflows/ci-integration-messaging.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,16 +31,26 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-messaging.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-process.yaml b/.github/workflows/ci-integration-process.yaml index 4fda27149fe6a..4510842905f32 100644 --- a/.github/workflows/ci-integration-process.yaml +++ b/.github/workflows/ci-integration-process.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,34 +31,50 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: run install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/docker-images/pom.xml install -am -Pdocker -DskipTests - name: clean docker container + if: steps.docs.outputs.changed_only == 'no' run: docker system prune -f - name: remove docker node image + if: steps.docs.outputs.changed_only == 'no' run: docker rmi -f node:10 && docker rmi -f node:12 && docker rmi -f buildpack-deps:stretch - name: remove docker builder and microsoft image + if: steps.docs.outputs.changed_only == 'no' run: docker rmi -f jekyll/builder:latest && docker rmi -f mcr.microsoft.com/azure-pipelines/node8-typescript:latest - name: run integration function + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-process.xml -DintegrationTests -DredirectTestOutputToFile=false -Dgroups=function - name: run integration source + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-process.xml -DintegrationTests -DredirectTestOutputToFile=false -Dgroups=source - name: run integraion sink + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-process.xml -DintegrationTests -DredirectTestOutputToFile=false -Dgroups=sink diff --git a/.github/workflows/ci-integration-schema.yaml b/.github/workflows/ci-integration-schema.yaml index af6f457e59833..71592cb045dc1 100644 --- a/.github/workflows/ci-integration-schema.yaml +++ b/.github/workflows/ci-integration-schema.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,16 +31,26 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-schema.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-sql.yaml b/.github/workflows/ci-integration-sql.yaml index 1a68323045c70..e5320ad7abc09 100644 --- a/.github/workflows/ci-integration-sql.yaml +++ b/.github/workflows/ci-integration-sql.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,21 +31,32 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-sql.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-standalone.yaml b/.github/workflows/ci-integration-standalone.yaml index 6d39512969813..1ecf0e56b2f6d 100644 --- a/.github/workflows/ci-integration-standalone.yaml +++ b/.github/workflows/ci-integration-standalone.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,16 +31,26 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-standalone.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-thread.yaml b/.github/workflows/ci-integration-thread.yaml index 282d44a959738..c30eaf3d8151d 100644 --- a/.github/workflows/ci-integration-thread.yaml +++ b/.github/workflows/ci-integration-thread.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,34 +31,50 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: run install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/docker-images/pom.xml install -am -Pdocker -DskipTests - name: clean docker container + if: steps.docs.outputs.changed_only == 'no' run: docker system prune -f - name: remove docker node image + if: steps.docs.outputs.changed_only == 'no' run: docker rmi -f node:10 && docker rmi -f node:12 && docker rmi -f buildpack-deps:stretch - name: remove docker builder and microsoft image + if: steps.docs.outputs.changed_only == 'no' run: docker rmi -f jekyll/builder:latest && docker rmi -f mcr.microsoft.com/azure-pipelines/node8-typescript:latest - name: run integration function + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-thread.xml -DintegrationTests -DredirectTestOutputToFile=false -Dgroups=function - name: run integration source + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-thread.xml -DintegrationTests -DredirectTestOutputToFile=false -Dgroups=source - name: run integraion sink + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=pulsar-thread.xml -DintegrationTests -DredirectTestOutputToFile=false -Dgroups=sink diff --git a/.github/workflows/ci-integration-tiered-filesystem.yaml b/.github/workflows/ci-integration-tiered-filesystem.yaml index 73f59d90af3a6..8e19ad0b35f83 100644 --- a/.github/workflows/ci-integration-tiered-filesystem.yaml +++ b/.github/workflows/ci-integration-tiered-filesystem.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,16 +31,26 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=tiered-filesystem-storage.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-integration-tiered-jcloud.yaml b/.github/workflows/ci-integration-tiered-jcloud.yaml index 04116633ee308..193a224531628 100644 --- a/.github/workflows/ci-integration-tiered-jcloud.yaml +++ b/.github/workflows/ci-integration-tiered-jcloud.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,16 +31,26 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: build artifacts and docker image + if: steps.docs.outputs.changed_only == 'no' run: mvn -B install -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR -Pdocker -DskipTests - name: run integration tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -f tests/pom.xml test -DintegrationTestSuiteFile=tiered-jcloud-storage.xml -DintegrationTests -DredirectTestOutputToFile=false diff --git a/.github/workflows/ci-license.yaml b/.github/workflows/ci-license.yaml index 820e433e7e643..22251c4fedce7 100644 --- a/.github/workflows/ci-license.yaml +++ b/.github/workflows/ci-license.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,22 +31,33 @@ jobs: timeout-minutes: 60 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - # license check fails with 3.6.2 so we have to downgrade - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: build and check license + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -ntp -DskipTests license:check install - name: license check + if: steps.docs.outputs.changed_only == 'no' run: src/check-binary-license ./distribution/server/target/apache-pulsar-*-bin.tar.gz diff --git a/.github/workflows/ci-unit-adaptors.yml b/.github/workflows/ci-unit-adaptors.yml index a5853e155656a..c414d6e8e17ff 100644 --- a/.github/workflows/ci-unit-adaptors.yml +++ b/.github/workflows/ci-unit-adaptors.yml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,24 +31,36 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: run unit tests install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: run unit tests pulsar io kafka connect adaptor + if: steps.docs.outputs.changed_only == 'no' run: mvn test -pl pulsar-io/kafka-connect-adaptor - name: run unit tests pulsar storm tests + if: steps.docs.outputs.changed_only == 'no' run: mvn test -pl tests/pulsar-storm-test diff --git a/.github/workflows/ci-unit-broker-sasl.yml b/.github/workflows/ci-unit-broker-sasl.yml index 6270efe01bc51..a03ca8517cadc 100644 --- a/.github/workflows/ci-unit-broker-sasl.yml +++ b/.github/workflows/ci-unit-broker-sasl.yml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,21 +31,32 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: run unit tests install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: run unit tests pulsar auth sasl + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false -pl pulsar-broker-auth-sasl diff --git a/.github/workflows/ci-unit-broker.yml b/.github/workflows/ci-unit-broker.yml index 5485bc2595135..1711c28f74f9c 100644 --- a/.github/workflows/ci-unit-broker.yml +++ b/.github/workflows/ci-unit-broker.yml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,42 +31,60 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: run unit tests install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: run unit tests pulsar broker reader test + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=ReaderTest' -pl pulsar-broker - name: run unit tests pulsar broker rack aware test + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=RackAwareTest' -pl pulsar-broker - name: run unit tests pulsar broker simple producer consumer test + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=SimpleProducerConsumerTest' -pl pulsar-broker - name: run unit tests pulsar broker V1 producer consumer test + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=V1_ProducerConsumerTest' -pl pulsar-broker - name: run unit tests pulsar broker persistent failover end to end test + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=PersistentFailoverE2ETest' -pl pulsar-broker - name: run unit tests pulsar broker client integration test + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=BrokerClientIntegrationTest' -pl pulsar-broker - name: run unit tests pulsar broker replicatior rate limiter test + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=ReplicatorRateLimiterTest' -pl pulsar-broker - name: run unit test pulsar-broker + if: steps.docs.outputs.changed_only == 'no' run: mvn test '-Dtest=!PersistentTransactionBufferTest,!PulsarFunctionE2ESecurityTest,!ServerCnxTest,!AdminApiOffloadTest,!AdminApiSchemaValidationEnforced,!V1_AdminApiTest2,!ProxyPublishConsumeTlsTest,!PulsarFunctionE2ETest,!MessageIdSerialization,!AdminApiTest2,!PulsarFunctionLocalRunTest,!PartitionedProducerConsumerTest,!KafkaProducerSimpleConsumerTest,!MessagePublishThrottlingTest,!ReaderTest,!RackAwareTest,!SimpleProducerConsumerTest,!V1_ProducerConsumerTest,!PersistentFailoverE2ETest,!BrokerClientIntegrationTest,!ReplicatorRateLimiterTest' -DfailIfNoTests=false -pl pulsar-broker diff --git a/.github/workflows/ci-unit-flaky.yaml b/.github/workflows/ci-unit-flaky.yaml index f47fa406a28d3..41f68e2b12f39 100644 --- a/.github/workflows/ci-unit-flaky.yaml +++ b/.github/workflows/ci-unit-flaky.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,32 +31,46 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: run PersistentTransactionBuffer test + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -am -pl pulsar-broker -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR clean install -Dtest=PersistentTransactionBufferTest -DfailIfNoTests=false - name: run ServerCnx test + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -am -pl pulsar-broker -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR clean install -Dtest=ServerCnxTest -DfailIfNoTests=false - name: run MessagePublishThrottling test + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -am -pl pulsar-broker -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR clean install -Dtest=MessagePublishThrottlingTest -DfailIfNoTests=false - name: run PrimitiveSchema test + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -am -pl pulsar-client -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR clean install -Dtest=PrimitiveSchemaTest -DfailIfNoTests=false - name: run unit tests + if: steps.docs.outputs.changed_only == 'no' run: mvn -B -Dorg.slf4j.simpleLogger.defaultLogLevel=ERROR clean install '-Dtest=PulsarFunctionE2ESecurityTest,AdminApiOffloadTest,AdminApiSchemaValidationEnforced,V1_AdminApiTest2,PulsarFunctionE2ETest,MessageIdSerialization,AdminApiTest2,PulsarFunctionLocalRunTest,PartitionedProducerConsumerTest,KafkaProducerSimpleConsumerTest,ProxyTest' -DfailIfNoTests=false - name: package surefire artifacts diff --git a/.github/workflows/ci-unit-proxy.yaml b/.github/workflows/ci-unit-proxy.yaml index d957b53223ecd..98d325c57a71f 100644 --- a/.github/workflows/ci-unit-proxy.yaml +++ b/.github/workflows/ci-unit-proxy.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,24 +31,36 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: run unit tests install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: run unit tests pulsar proxy + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=!ProxyTest,!ProxyLookupThrottlingTest' -pl pulsar-proxy - name: run unit tests pulsar proxy + if: steps.docs.outputs.changed_only == 'no' run: mvn test -DfailIfNoTests=false '-Dtest=ProxyTest,ProxyLookupThrottlingTest' -pl pulsar-proxy diff --git a/.github/workflows/ci-unit.yaml b/.github/workflows/ci-unit.yaml index a0b566ca3a764..225a717781f26 100644 --- a/.github/workflows/ci-unit.yaml +++ b/.github/workflows/ci-unit.yaml @@ -22,8 +22,6 @@ on: pull_request: branches: - master - paths-ignore: - - '**.md' jobs: @@ -33,23 +31,34 @@ jobs: timeout-minutes: 120 steps: + - name: checkout + uses: actions/checkout@v1 + + - name: Check if this pull request only changes documentation + id: docs + # TODO: move this action to an apache repo + uses: sijie/pulsar-github-actions/diff-only@master + with: + args: site2 .github deployment + - name: Set up JDK 1.8 uses: actions/setup-java@v1 + if: steps.docs.outputs.changed_only == 'no' with: java-version: 1.8 - - name: checkout - uses: actions/checkout@v1 - - name: Set up Maven uses: aahmed-se/setup-maven@v3 + if: steps.docs.outputs.changed_only == 'no' with: maven-version: 3.6.1 - name: run unit tests install by skip tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DskipTests - name: run unit tests + if: steps.docs.outputs.changed_only == 'no' run: mvn clean install -DfailIfNoTests=false '-Dtest=!KafkaProducerSimpleConsumerTest,!PrimitiveSchemaTest' -pl '!pulsar-broker,!pulsar-proxy,!pulsar-broker-auth-sasl,!pulsar-io/kafka-connect-adaptor,!tests/pulsar-storm-test' - name: package surefire artifacts