Skip to content

Commit edfd24d

Browse files
authored
Merge pull request llm-d-incubation#108 from amito/feat/repo-improvements
Add GitHub Actions CI/CD and modernize type hints to PEP 604
2 parents 9c50b37 + 0e14391 commit edfd24d

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: astral-sh/setup-uv@v5
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
- run: uv sync --extra dev
24+
- name: Ruff check
25+
run: uv run ruff check src/ tests/
26+
- name: Ruff format check
27+
run: uv run ruff format --check src/ tests/
28+
29+
typecheck:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: astral-sh/setup-uv@v5
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.12"
37+
- run: uv sync --extra dev
38+
- name: Mypy type check
39+
run: uv run mypy src/
40+
41+
test:
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
python-version: ["3.11", "3.12"]
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: astral-sh/setup-uv@v5
49+
- uses: actions/setup-python@v5
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
- run: uv sync --extra dev
53+
- name: Run unit tests
54+
run: >
55+
uv run pytest tests/ -v --tb=short
56+
-m "not database and not integration"
57+
--cov=src/neuralnav
58+
--cov-report=xml
59+
--cov-report=term
60+
61+
ci-status:
62+
if: always()
63+
needs: [lint, typecheck, test]
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Check CI status
67+
run: |
68+
if [[ "${{ needs.lint.result }}" != "success" ||
69+
"${{ needs.typecheck.result }}" != "success" ||
70+
"${{ needs.test.result }}" != "success" ]]; then
71+
echo "CI failed"
72+
exit 1
73+
fi
74+
echo "CI passed"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# <img src="docs/neuralnav-logo.ico" alt="NeuralNav" width="32" style="vertical-align: middle;"/> NeuralNav
22

3+
[![CI](https://github.com/redhat-et/neuralnav/actions/workflows/ci.yml/badge.svg)](https://github.com/redhat-et/neuralnav/actions/workflows/ci.yml)
4+
[![Python 3.11+](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org)
5+
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
6+
37
**Confidently navigate LLM deployments from concept to production.**
48

59
---

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,5 @@ asyncio_default_fixture_loop_scope = "session"
129129
markers = [
130130
"database: marks tests that require a running PostgreSQL database with benchmark data",
131131
"integration: marks tests as integration tests (requires Ollama and database)",
132+
"unit: marks tests as unit tests (no external dependencies)",
132133
]

0 commit comments

Comments
 (0)