Skip to content

Commit 3c889d3

Browse files
authored
Refactor CI workflow for Python with new checks
1 parent ca6a79b commit 3c889d3

1 file changed

Lines changed: 29 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,39 @@
1-
name: Python CI
1+
name: CI
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
88

99
jobs:
10-
build:
10+
quality:
11+
name: Lint / Type / Security / Test
1112
runs-on: ubuntu-latest
1213
strategy:
1314
matrix:
14-
python-version: ["3.10", "3.11"]
15-
15+
python-version: ["3.10", "3.11", "3.12"]
1616
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

Comments
 (0)