Skip to content

Commit 55b94eb

Browse files
committed
added ci config for git workflow
1 parent 88a09b3 commit 55b94eb

2 files changed

Lines changed: 64 additions & 3 deletions

File tree

.github/workflow/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "**"
7+
8+
env:
9+
PYTHON_VERSION: "3.14"
10+
11+
jobs:
12+
types:
13+
# 1. MyPy strict type checking
14+
name: "Type check"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ env.PYTHON_VERSION }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ env.PYTHON_VERSION }}
23+
allow-prereleases: true
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v8.1.0
27+
with:
28+
enable-cache: true
29+
cache-dependency-glob: "pyproject.toml"
30+
31+
- name: Install dependencies
32+
run: uv sync --group types --frozen
33+
34+
- name: Run mypy
35+
run: uv run --group types mypy src/
36+
37+
# 2: ruff lint + format check
38+
fmt-check:
39+
name: "Format & lint check"
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up Python ${{ env.PYTHON_VERSION }}
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: ${{ env.PYTHON_VERSION }}
48+
allow-prereleases: true
49+
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v8.1.0
52+
with:
53+
enable-cache: true
54+
cache-dependency-glob: "pyproject.toml"
55+
56+
- name: Install dependencies
57+
run: uv sync --group fmt --frozen
58+
59+
- name: Check lint
60+
run: uv run --group fmt ruff check .
61+
62+
- name: Check format
63+
run: uv run --group fmt ruff format --check .

.pre-commit-config.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ repos:
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
2020
rev: v0.15.2
2121
hooks:
22-
- id: ruff
23-
args: [ --fix ]
2422
- id: ruff-format
2523

2624
- repo: https://github.com/codespell-project/codespell
2725
rev: v2.4.1
2826
hooks:
2927
- id: codespell
30-
exclude: "haystack/data/abbreviations"
28+
exclude: "examples"
3129
args: ["--toml", "pyproject.toml"]
3230
additional_dependencies:
3331
- tomli

0 commit comments

Comments
 (0)