[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.
This commit is contained in:
30
.github/workflows/checkstyle.yaml
vendored
30
.github/workflows/checkstyle.yaml
vendored
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user