Skip to content

Cherry pp layers

Cherry pp layers #358

Workflow file for this run

name: Codestyle
on:
pull_request:
branches:
- develop
jobs:
pre-commit:
name: Codestyle Check
if: github.repository == 'PaddlePaddle/PaddleFleet'
runs-on: ubuntu-latest
env:
PR_ID: ${{ github.event.pull_request.number }}
BRANCH: develop
steps:
- name: Checkout base repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 1000
- name: Merge PR to test branch
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
git fetch origin pull/${PR_ID}/merge
git checkout -b test FETCH_HEAD
- name: Check bypass
id: check-bypass
uses: ./.github/actions/check-bypass
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
workflow-name: codestyle
- name: Setup python3.12
if: steps.check-bypass.outputs.can-skip != 'true'
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
pip install pre-commit==2.17.0 cpplint==1.6.0 clang-format==13.0.0
- name: Check pre-commit
id: pre-commit
if: steps.check-bypass.outputs.can-skip != 'true'
continue-on-error: true
run: |
pre-commit run --all-files
- name: Failure message
if: steps.pre-commit.outcome == 'failure'
run: |
echo "::error::Codestyle check failed."
echo "::error::Please install pre-commit and run the following commands locally to fix the issues:"
echo "::error::"
echo "::error:: pip install pre-commit==2.17.0 cpplint==1.6.0 clang-format==13.0.0"
echo "::error:: pre-commit run --all-files"
exit 1