From d7004f5bdbe1f1897dd5083d4260ee90e5a1aa17 Mon Sep 17 00:00:00 2001 From: zhanglinjing Date: Wed, 6 Nov 2024 14:21:54 +0100 Subject: [PATCH] CI: add pre-commit on workflow --- .github/workflows/pre-commit.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/pre-commit.yaml diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 00000000..9be2af1d --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,28 @@ +name: Pre-commit checks + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + pre-commit: + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files \ No newline at end of file