Skip to content

Commit e1bf36a

Browse files
committed
feat(ci): add GitHub Actions workflows for CI/CD
- Implement test.yml for continuous integration - Tests across Python 3.9-3.13 on multiple OS - Includes linting, formatting, type checking, and coverage - Implement publish.yml for automated PyPI publishing - Builds and publishes the package on release - Update TODO list to reflect CI/CD implementation
1 parent d0fcb47 commit e1bf36a

File tree

4 files changed

+114
-5
lines changed

4 files changed

+114
-5
lines changed

.github/workflows/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# GitHub Actions Workflows
2+
3+
This directory contains CI/CD workflows for the sqlite-vec-client project.
4+
5+
## Workflows
6+
7+
### test.yml - Continuous Integration
8+
Runs on every push and pull request to `main` and `develop` branches.
9+
10+
**What it does:**
11+
- Tests across Python 3.9-3.13
12+
- Tests on Ubuntu, Windows, and macOS
13+
- Runs linting (ruff check)
14+
- Runs format checking (ruff format)
15+
- Runs type checking (mypy)
16+
- Runs test suite with coverage report
17+
18+
### publish.yml - PyPI Publishing
19+
Runs automatically when a GitHub release is published.
20+
21+
**What it does:**
22+
- Builds the package
23+
- Publishes to PyPI using the PYPI_API_TOKEN secret
24+
25+
## Setup Requirements
26+
27+
### For PyPI Publishing
28+
1. Generate a PyPI API token at [pypi.org](https://pypi.org/manage/account/token/)
29+
2. Add `PYPI_API_TOKEN` to GitHub repository secrets
30+
31+
## Badge URL
32+
33+
Add this to your README.md:
34+
35+
```markdown
36+
[![CI](https://github.com/atasoglu/sqlite-vec-client/actions/workflows/test.yml/badge.svg)](https://github.com/atasoglu/sqlite-vec-client/actions/workflows/test.yml)
37+
```

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
19+
- name: Install build dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build twine
23+
24+
- name: Build package
25+
run: python -m build
26+
27+
- name: Publish to PyPI
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31+
run: twine upload dist/*

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e .
29+
pip install -r requirements-dev.txt
30+
31+
- name: Lint with ruff
32+
run: ruff check .
33+
34+
- name: Format check with ruff
35+
run: ruff format --check .
36+
37+
- name: Type check with mypy
38+
run: mypy sqlite_vec_client/
39+
40+
- name: Test with pytest
41+
run: pytest --cov=sqlite_vec_client --cov-report=term

TODO

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
- [x] Create requirements-dev.txt
4949

5050
### CI/CD
51-
- [ ] GitHub Actions workflow (.github/workflows/test.yml)
52-
- [ ] Automated test execution
53-
- [ ] Code coverage reporting
54-
- [ ] Automated PyPI publishing
55-
- [ ] Linting and type checking
51+
- [x] GitHub Actions workflow (.github/workflows/test.yml)
52+
- [x] Automated test execution
53+
- [x] Code coverage reporting
54+
- [x] Automated PyPI publishing
55+
- [x] Linting and type checking
5656

5757
### Logging
5858
- [x] Python logging module integration

0 commit comments

Comments
 (0)