From 7bb2343505218b7ae5f4e9390fb582e2aee1ffc2 Mon Sep 17 00:00:00 2001 From: Adonis Ling Date: Sat, 3 Dec 2022 13:26:09 +0800 Subject: [PATCH] [chore](github) Optimize the workflow FE Code Style Checker (#14751) We can reduce the times of checking out the codebase to boost the performance of the workflow. --- .github/workflows/checkstyle.yaml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/checkstyle.yaml b/.github/workflows/checkstyle.yaml index 0eca6722af..13ab46b2cd 100644 --- a/.github/workflows/checkstyle.yaml +++ b/.github/workflows/checkstyle.yaml @@ -17,45 +17,39 @@ # --- name: FE Code Style Checker + on: pull_request: + jobs: - changes: - name: Detect Changes + java-checkstyle: + name: "CheckStyle" runs-on: ubuntu-latest - outputs: - broker_changes: ${{ steps.filter.outputs.broker_changes }} - docs_changes: ${{ steps.filter.outputs.docs_changes }} steps: - - name: Checkout ${{ github.ref }} + - name: Checkout uses: actions/checkout@v3 with: persist-credentials: false submodules: recursive - - name: Paths filter + - name: Paths Filter uses: ./.github/actions/paths-filter id: filter with: filters: | fe_changes: - 'fe/**' - java-checkstyle: - name: "CheckStyle" - needs: changes - if: ${{ needs.changes.outputs.fe_changes == 'true' }} - runs-on: ubuntu-latest - steps: - - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" - uses: actions/checkout@v2 - with: - persist-credentials: false - submodules: recursive + - 'gensrc/proto/**' + - 'gensrc/thrift/**' + - name: Setup Maven Action + if: steps.filter.outputs.fe_changes == 'true' uses: ./.github/actions/setup-maven with: maven-version: 3.8.4 + - name: Run java checkstyle + if: steps.filter.outputs.fe_changes == 'true' run: cd fe && mvn clean checkstyle:check