diff --git a/.github/workflows/unit-and-integration-tests-unified.yml b/.github/workflows/unit-and-integration-tests-unified.yml index 11a7d17944be..6f33276e9555 100644 --- a/.github/workflows/unit-and-integration-tests-unified.yml +++ b/.github/workflows/unit-and-integration-tests-unified.yml @@ -157,6 +157,55 @@ jobs: echo ${{ needs.set-env-var.outputs.DRUID_PREVIOUS_IT_IMAGE_NAME }} docker save "${{ needs.set-env-var.outputs.DRUID_PREVIOUS_IT_IMAGE_NAME }}" | gzip > druid-container-jdk${{ matrix.jdk }}-version${{ needs.set-env-var.outputs.DRUID_PREVIOUS_VERSION }}.tar.gz + # check if it is a PR and if it is approved. For approved PRs, we do not want to run tests sequentially + check-approval: + runs-on: ubuntu-latest + outputs: + approved: ${{ steps.check.outputs.isApproved }} + steps: + - name: Check if Triggered by a PR + id: determine-trigger + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "isPR=true" >> $GITHUB_ENV + else + echo "isPR=false" >> $GITHUB_ENV + + - name: Check PR Approval (if applicable) + id: check + if: ${{ env.isPR == 'true' }} + uses: actions/github-script@v7 + with: + script: | + const reviews = await github.rest.pulls.listReviews({ + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number + }); + const approved = reviews.data.some(review => review.state === 'APPROVED'); + core.setOutput("isApproved", approved); + + - name: Default to Approved for Branch + id: default-check + if: ${{ env.isPR == 'false' }} + run: echo "::set-output name=isApproved::true" + + unit-tests-unapproved: + name: "unit tests - PR unapproved - (jdk17)" + uses: ./.github/workflows/unit-tests.yml + needs: [build, check-approval] + if: ${{ needs.check-approval.outputs.approved != 'true' }} + with: + jdk: 17 + + unit-tests-approved: + name: "unit tests - PR approved - (jdk17)" + uses: ./.github/workflows/unit-tests.yml + needs: [build, check-approval] + if: ${{ needs.check-approval.outputs.approved == 'true' }} + with: + jdk: 17 + unit-tests-phase2: strategy: fail-fast: false @@ -165,26 +214,19 @@ jobs: jdk: [ '11', '21.0.4' ] name: "unit tests (jdk${{ matrix.jdk }})" uses: ./.github/workflows/unit-tests.yml - needs: unit-tests - if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }} + needs: [unit-tests-unapproved, check-approval] + if: ${{ always() && (needs.check-approval.outputs.approved == 'true' || needs.unit-tests-unapproved.result == 'success' || needs.unit-tests-unapproved.outputs.continue_tests) }} with: jdk: ${{ matrix.jdk }} - unit-tests: - name: "unit tests (jdk17)" - uses: ./.github/workflows/unit-tests.yml - needs: build - with: - jdk: 17 - standard-its: - needs: unit-tests - if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }} + needs: [unit-tests-unapproved, check-approval] + if: ${{ always() && (needs.check-approval.outputs.approved == 'true' || needs.unit-tests-unapproved.result == 'success' || needs.unit-tests-unapproved.outputs.continue_tests) }} uses: ./.github/workflows/standard-its.yml revised-its: - needs: [unit-tests, set-env-var] - if: ${{ always() && (needs.unit-tests.result == 'success' || needs.unit-tests.outputs.continue_tests) }} + needs: [unit-tests-unapproved, check-approval, set-env-var] + if: ${{ always() && (needs.check-approval.outputs.approved == 'true' || needs.unit-tests-unapproved.result == 'success' || needs.unit-tests-unapproved.outputs.continue_tests) }} uses: ./.github/workflows/revised-its.yml with: BACKWARD_COMPATIBILITY_IT_ENABLED: ${{ needs.set-env-var.outputs.BACKWARD_COMPATIBILITY_IT_ENABLED }} diff --git a/codestyle/checkstyle.xml b/codestyle/checkstyle.xml index da70ddfad3ae..696f18016836 100644 --- a/codestyle/checkstyle.xml +++ b/codestyle/checkstyle.xml @@ -20,8 +20,8 @@ --> + "-//Puppy Crawl//DTD Check Configuration 1.3//EN" + "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> diff --git a/pom.xml b/pom.xml index b5d2a25cd662..cc7cdaddb2f3 100644 --- a/pom.xml +++ b/pom.xml @@ -1508,7 +1508,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.0.0 + 3.6.0 ${project.build.sourceDirectory} @@ -1517,7 +1517,6 @@ codestyle/checkstyle.xml codestyle/checkstyle-suppressions.xml checkstyle.suppressions.file - UTF-8 codestyle/LICENSE.txt true true @@ -1529,7 +1528,7 @@ com.puppycrawl.tools checkstyle - 8.21 + 10.20.1