Skip to content

Commit

Permalink
tests: add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gusye1234 committed Aug 21, 2024
1 parent 2ae8547 commit 92c10f0
Show file tree
Hide file tree
Showing 5 changed files with 950 additions and 27 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: test

on:
push:
branches:
- main
- dev
paths-ignore:
- '**/*.md'
- '**/*.ipynb'
pull_request:
branches:
- main
- dev
paths-ignore:
- '**/*.md'
- '**/*.ipynb'

jobs:
test:
name: Tests on ${{ matrix.os }} for ${{ matrix.python-version }}
strategy:
matrix:
python-version: [3.9]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Build and Test
run: |
python -m pytest -o log_cli=true -o log_cli_level="INFO" -v ./
# - name: Check codecov file
# id: check_files
# uses: andstor/file-existence-action@v1
# with:
# files: './coverage.xml'
# - name: Upload coverage from test to Codecov
# uses: codecov/codecov-action@v2
# with:
# file: ./coverage.xml
# token: ${{ secrets.CODECOV_TOKEN }}
7 changes: 6 additions & 1 deletion nano_graphrag/graphrag.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,9 @@ async def _insert_done(self):
await asyncio.gather(*tasks)

async def _query_done(self):
pass
tasks = []
for storage_inst in [self.llm_response_cache]:
if storage_inst is None:
continue
tasks.append(cast(StorageNameSpace, storage_inst).index_done_callback())
await asyncio.gather(*tasks)
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sentence_transformers
flake8
pytest
Loading

0 comments on commit 92c10f0

Please sign in to comment.