-
Notifications
You must be signed in to change notification settings - Fork 105
117 lines (94 loc) · 3.37 KB
/
Copy pathci.yml
File metadata and controls
117 lines (94 loc) · 3.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# CI - Run tests on every push and PR
#
# This ensures all PRs pass tests before merging to main.
# Tests run on multiple Python versions for compatibility.
#
# Jobs:
# 1. pre-commit: Code quality checks (formatting, linting, secrets)
# 2. test: Unit tests on Python 3.10-3.12
# 3. coverage: Test coverage reporting
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
# Code quality checks
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
node-test:
runs-on: ubuntu-latest
needs: pre-commit
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: mcp-sse-server/package-lock.json
- name: Install dependencies
working-directory: mcp-sse-server
run: npm ci
- name: Run tests
working-directory: mcp-sse-server
run: npm test
test:
runs-on: ubuntu-latest
needs: pre-commit
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 app.py automem/ --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings (for now)
flake8 app.py automem/ --count --exit-zero --max-line-length=100 --statistics
- name: Run tests
run: |
pytest tests/ -v --ignore=tests/benchmarks
# Optional: Run on a single version with coverage
coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install pytest-cov
- name: Run tests with coverage
run: |
pytest tests/ -v --ignore=tests/benchmarks --cov=automem --cov=app --cov-report=xml
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false