summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormike8699 <mikebuntu68@gmail.com>2025-01-01 21:22:40 -0500
committermike8699 <mikebuntu68@gmail.com>2025-01-01 21:22:40 -0500
commit2d8b257711ec638ec77bde1674df089d9d75dadf (patch)
tree6bfc8a2f0bed35d2fb4f81009e7958be5ba9ce2e
parent83e058a8a11e9764d5674100a77310b5f10fee7c (diff)
Run clang-format/other pre-commit checks in CI
-rw-r--r--.github/workflows/ci.yaml31
1 files changed, 31 insertions, 0 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 00000000..e24acd17
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,31 @@
+name: CI
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+jobs:
+ lint:
+ name: Linting/style checks
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.13'
+ check-latest: true
+
+ - name: Install pre-commit
+ run: pip install pre-commit
+
+ - name: Cache pre-commit hooks
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/pre-commit/
+ # Invalidate the cache if the pre-commit config changes or the Python version changes
+ key: pre-commit-cache|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
+
+ - name: Run pre-commit checks
+ run: pre-commit run --all-files --verbose