Skip to content

Commit f3830f3

Browse files
authored
Update ci.yml
1 parent 1d85783 commit f3830f3

File tree

1 file changed

+45
-23
lines changed

1 file changed

+45
-23
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI (lean)
1+
name: CI (uv)
22

33
on:
44
push:
@@ -7,37 +7,59 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
build:
11-
runs-on: ubuntu-latest
10+
test:
11+
name: Tests (${{ matrix.os }} | py${{ matrix.python-version }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, macos-14, windows-latest]
17+
python-version: ["3.11"]
18+
19+
env:
20+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
21+
PYTHONUNBUFFERED: "1"
22+
# Make pytest output calm but useful
23+
PYTEST_ADDOPTS: "-q --maxfail=1 -ra"
24+
# Ensure tests can import workbench_core from repo root
25+
PYTHONPATH: ${{ github.workspace }}
26+
1227
steps:
13-
- uses: actions/checkout@v4
28+
- name: Checkout
29+
uses: actions/checkout@v4
1430

15-
- name: Set up Python
31+
- name: Setup Python ${{ matrix.python-version }}
1632
uses: actions/setup-python@v5
1733
with:
18-
python-version: '3.11'
34+
python-version: ${{ matrix.python-version }}
35+
cache: "pip"
1936

2037
- name: Install uv
21-
run: |
22-
pip install uv
38+
run: python -m pip install -q uv
2339

24-
- name: Sync deps (frozen if lock exists)
25-
run: |
26-
if [ -f uv.lock ]; then
27-
uv sync --frozen
28-
else
29-
uv sync || true
30-
fi
40+
# Use workflow-level conditions instead of shell conditionals (works on Windows too)
41+
- name: Sync deps (frozen)
42+
if: ${{ hashFiles('uv.lock') != '' }}
43+
run: uv sync --frozen
3144

45+
- name: Sync deps
46+
if: ${{ hashFiles('uv.lock') == '' }}
47+
run: uv sync
48+
49+
# Ensure dev tools exist even if not declared as deps
3250
- name: Install dev tools
33-
run: |
34-
pip install ruff mypy bandit
51+
run: uv pip install -q ruff pytest mypy bandit
52+
53+
- name: Lint (ruff, concise)
54+
run: uv run ruff check . --output-format=concise
3555

36-
- name: Lint (ruff)
37-
run: python -m ruff check .
56+
- name: Type-check (mypy, non-blocking)
57+
continue-on-error: true
58+
run: uv run mypy --ignore-missing-imports .
3859

39-
- name: Type-check (mypy, lenient)
40-
run: python -m mypy --ignore-missing-imports . || true
60+
- name: Security scan (bandit, non-blocking)
61+
continue-on-error: true
62+
run: uv run bandit -q -r .
4163

42-
- name: Smoke test
43-
run: make test
64+
- name: Run tests
65+
run: uv run pytest

0 commit comments

Comments
 (0)