|
1 | | -name: Python CI |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ "main" ] |
| 5 | + branches: ["main"] |
6 | 6 | pull_request: |
7 | | - branches: [ "main" ] |
| 7 | + branches: ["main"] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - build: |
| 10 | + quality: |
| 11 | + name: Lint / Type / Security / Test |
11 | 12 | runs-on: ubuntu-latest |
12 | 13 | strategy: |
13 | 14 | matrix: |
14 | | - python-version: ["3.10", "3.11"] |
15 | | - |
| 15 | + python-version: ["3.10", "3.11", "3.12"] |
16 | 16 | steps: |
17 | | - - uses: actions/checkout@v7 |
18 | | - |
19 | | - - name: Set up Python ${{ matrix.python-version }} |
20 | | - uses: actions/setup-python@v4 |
21 | | - with: |
22 | | - python-version: ${{ matrix.python-version }} |
23 | | - |
24 | | - - name: Install dependencies |
25 | | - run: | |
26 | | - python -m pip install --upgrade pip |
27 | | - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
28 | | - pip install ruff pytest |
29 | | - |
30 | | - - name: Lint with Ruff |
31 | | - run: | |
32 | | - # Stop the build if there are Python syntax errors or undefined names |
33 | | - ruff check . --select=E9,F63,F7,F82 --output-format=github |
34 | | - # Default linting (ignoring rule violations to just show warnings) |
35 | | - ruff check . --exit-zero |
36 | | - |
37 | | - - name: Test with pytest |
38 | | - run: | |
39 | | - if [ -d "tests" ]; then |
40 | | - pytest tests/ || echo "No tests found or tests failed - continuing for now" |
41 | | - else |
42 | | - echo "No tests directory found." |
43 | | - fi |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Set up Python ${{ matrix.python-version }} |
| 20 | + uses: actions/setup-python@v5 |
| 21 | + with: |
| 22 | + python-version: ${{ matrix.python-version }} |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: | |
| 26 | + python -m pip install --upgrade pip |
| 27 | + pip install -e ".[dev]" |
| 28 | +
|
| 29 | + - name: Ruff (lint) |
| 30 | + run: ruff check . |
| 31 | + |
| 32 | + - name: Mypy (static type check) |
| 33 | + run: mypy epistemic_forge |
| 34 | + |
| 35 | + - name: Bandit (security scan) |
| 36 | + run: bandit -r epistemic_forge -q --severity-level medium |
| 37 | + |
| 38 | + - name: Pytest (with coverage) |
| 39 | + run: pytest --cov=epistemic_forge --cov-report=term-missing --cov-fail-under=70 |
0 commit comments