Jorge-AM commited on
Commit
f124a33
·
1 Parent(s): 020b38e

ci: Add workflow and pin the lint toolchain

Browse files
Files changed (3) hide show
  1. .github/workflows/ci.yml +30 -0
  2. .gitignore +6 -0
  3. ruff.toml +15 -0
.github/workflows/ci.yml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+ cache: pip
19
+ cache-dependency-path: requirements-dev.txt
20
+
21
+ - name: Install dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install -r requirements-dev.txt
25
+
26
+ - name: Lint
27
+ run: ruff check .
28
+
29
+ - name: Test
30
+ run: pytest
.gitignore CHANGED
@@ -22,3 +22,9 @@ model_cache/
22
  # System
23
  .DS_Store
24
  Thumbs.db
 
 
 
 
 
 
 
22
  # System
23
  .DS_Store
24
  Thumbs.db
25
+
26
+ # Testing
27
+ .pytest_cache/
28
+ .coverage
29
+ htmlcov/
30
+ .ruff_cache/
ruff.toml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Explicit lint contract: without it, "ruff check" means whatever the
2
+ # installed version defaults to, and CI breaks on unrelated ruff releases.
3
+ line-length = 100
4
+ exclude = ["venv", ".venv"]
5
+
6
+ [lint]
7
+ select = [
8
+ "E4", # pycodestyle: imports
9
+ "E7", # pycodestyle: statements
10
+ "E9", # pycodestyle: runtime errors
11
+ "F", # pyflakes: dead imports, undefined names
12
+ "I", # isort: import ordering
13
+ "B", # flake8-bugbear: likely bugs
14
+ "UP", # pyupgrade: outdated idioms
15
+ ]