From 8c1aef25632ccb583e1723e35dbe4f687069cd3a Mon Sep 17 00:00:00 2001 From: Andrew Liu Date: Sun, 14 Apr 2024 10:23:26 +0000 Subject: [PATCH] pre-commit ci-cd --- .github/workflows/ci-cd.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 000000000..61bd1ca8a --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,38 @@ +name: CI/CD + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + pre-commit: + name: run pre-commit + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: "pip" + + - name: Install pre-commit + run: python -m pip install pre-commit + shell: bash + + - name: Cache pre-commit + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + + - name: Run pre-commit + run: pre-commit run --show-diff-on-failure --color=always --all-files + shell: bash