feat: add error test (#132) #332
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'examples/**' | |
- '.gitignore' | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- '**.md' | |
- 'examples/**' | |
- '.gitignore' | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 1 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
- name: Install Dev dependencies | |
run: | | |
pip install langchain openai pytest ruff mypy pymysql pytest-asyncio types-PyMySQL | |
# TODO(yuanbohan): code coverage with pytest-cov | |
- name: Test with pytest | |
env: | |
GREPTIMEAI_HOST: ${{ secrets.GREPTIMEAI_HOST }} | |
GREPTIMEAI_DATABASE: ${{ secrets.GREPTIMEAI_DATABASE }} | |
GREPTIMEAI_TOKEN: ${{ secrets.GREPTIMEAI_TOKEN }} | |
MYSQL_HOST: ${{ secrets.MYSQL_HOST }} | |
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} | |
MYSQL_USERNAME: ${{ secrets.MYSQL_USERNAME }} | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: | | |
pytest -s -v tests/ | |
- name: Lint & Format with Ruff | |
run: | | |
ruff check --output-format=github . | |
ruff format . | |
- name: Static Type Checking with mypy | |
run: | | |
mypy $(git ls-files '*.py') --check-untyped-defs | |
concurrency: | |
group: ${{ github.repository }} | |
cancel-in-progress: true |