From bfdfb2abc718de8436d1dcdbbb9888f4c6fe3c89 Mon Sep 17 00:00:00 2001 From: Yiyu Ni Date: Mon, 26 Feb 2024 19:14:45 -0800 Subject: [PATCH] add precommit ci --- .github/workflows/precommit.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/precommit.yaml diff --git a/.github/workflows/precommit.yaml b/.github/workflows/precommit.yaml new file mode 100644 index 0000000..f9bf7c3 --- /dev/null +++ b/.github/workflows/precommit.yaml @@ -0,0 +1,21 @@ +name: pre-commit checks + +on: + pull_request: + push: { branches: [main] } + workflow_dispatch: + +jobs: + pre-commit-checks: + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repo + uses: actions/checkout@v3.3.0 + - name: Setup Python + uses: actions/setup-python@v4.5.0 + with: + python-version: '3.10' + - name: Install pre-commit and Jupyter + run: pip install pre-commit==3.3.3 jupyter==1.0.0 + - name: Run pre-commit checks + run: pre-commit run --show-diff-on-failure