Skip to content

Commit c6f49d6

Browse files
author
Sam Partee
authored
Enable CI (#18)
Enable Github CI to run tests and post code coverage.
1 parent 8dc8798 commit c6f49d6

File tree

5 files changed

+78
-5
lines changed

5 files changed

+78
-5
lines changed

.coveragerc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[run]
2+
omit =
3+
# Omit the test directory:
4+
tests/*
5+
6+
redisvl/cli/*
7+
8+
9+
[report]
10+
# Exclude lines that are not relevant to coverage report
11+
exclude_lines =
12+
# Have to re-enable the standard pragma
13+
pragma: no cover
14+
15+
# Don't complain about missing debug-only code:
16+
def __repr__
17+
if self\.debug
18+
19+
# Don't complain if tests don't hit defensive assertion code:
20+
raise AssertionError
21+
raise NotImplementedError
22+
23+
# Don't complain if non-runnable code isn't run:
24+
if 0:
25+
if __name__ == .__main__.:

.github/workflows/run_tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test Suite
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
test:
11+
name: Test on ${{ matrix.python-version }} - ${{ matrix.os }}
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
python-version: [3.8, 3.9, '3.10', 3.11]
17+
18+
services:
19+
redis:
20+
image: redis/redis-stack-server:latest
21+
ports:
22+
- 6379:6379
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install .[dev,all]
34+
- name: Start Redis
35+
run: |
36+
REDIS_ADDRESS=redis://localhost:6379
37+
echo REDIS_ADDRESS=$REDIS_ADDRESS >> $GITHUB_ENV
38+
- name: Run tests
39+
env:
40+
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
41+
run: |
42+
make test-cov
43+
- name: Publish coverage results
44+
uses: codecov/codecov-action@v2
45+
with:
46+
token: ${{ secrets.CODECOV_TOKEN }}
47+
fail_ci_if_error: true

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
__pycache__/
22
redisvl.egg-info/
3-
.coverage*
3+
.coverage.*
4+
.coverage
45
scratch
6+
.DS_Store

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
numpy>=1.23.2
1+
numpy
22
redis>=4.3.4
3-
pandas>=1.5.5
3+
pandas>1.3.0
44
pyyaml
55
coloredlogs
66
pydantic>=2.0.0

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ def read_dev_requirements():
1414
extras_require = {
1515
"all": [
1616
"openai>=0.26.4",
17-
"sentence-transformers>=2.2.2",
18-
"pandas==1.5.1"
17+
"sentence-transformers>=2.2.2"
1918
],
2019
"dev": read_dev_requirements()
2120
}

0 commit comments

Comments
 (0)