Skip to content

Commit

Permalink
chore: use shared steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Anyc66666666 committed Dec 11, 2023
1 parent a4a20e5 commit 60ef519
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 132 deletions.
140 changes: 8 additions & 132 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.8"

- 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
# TODO(yuanbohan): code coverage with pytest-cov
- name: Test with pytest
env:
GREPTIMEAI_HOST: ${{ secrets.GREPTIMEAI_HOST }}
GREPTIMEAI_USERNAME: ${{ secrets.GREPTIMEAI_USERNAME }}
GREPTIMEAI_PASSWORD: ${{ secrets.GREPTIMEAI_PASSWORD }}
GREPTIMEAI_DATABASE: ${{ secrets.GREPTIMEAI_DATABASE }}
GREPTIMEAI_TOKEN: ${{ secrets.GREPTIMEAI_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pytest tests/ -v
- 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
- name: shared-steps
uses: ./.github/workflows/shared-steps.yml

ci-3-9:
runs-on: ubuntu-latest
Expand All @@ -71,39 +40,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.9"

- 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
# TODO(yuanbohan): code coverage with pytest-cov
- name: Test with pytest
env:
GREPTIMEAI_HOST: ${{ secrets.GREPTIMEAI_HOST }}
GREPTIMEAI_USERNAME: ${{ secrets.GREPTIMEAI_USERNAME }}
GREPTIMEAI_PASSWORD: ${{ secrets.GREPTIMEAI_PASSWORD }}
GREPTIMEAI_DATABASE: ${{ secrets.GREPTIMEAI_DATABASE }}
GREPTIMEAI_TOKEN: ${{ secrets.GREPTIMEAI_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pytest tests/ -v
- 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
- name: shared-steps
uses: ./.github/workflows/shared-steps.yml

ci-3-10:
runs-on: ubuntu-latest
Expand All @@ -115,39 +53,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"

- 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
# TODO(yuanbohan): code coverage with pytest-cov
- name: Test with pytest
env:
GREPTIMEAI_HOST: ${{ secrets.GREPTIMEAI_HOST }}
GREPTIMEAI_USERNAME: ${{ secrets.GREPTIMEAI_USERNAME }}
GREPTIMEAI_PASSWORD: ${{ secrets.GREPTIMEAI_PASSWORD }}
GREPTIMEAI_DATABASE: ${{ secrets.GREPTIMEAI_DATABASE }}
GREPTIMEAI_TOKEN: ${{ secrets.GREPTIMEAI_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pytest tests/ -v
- 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
- name: shared-steps
uses: ./.github/workflows/shared-steps.yml

ci-3-11:
runs-on: ubuntu-latest
Expand All @@ -159,39 +66,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.11"

- 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
# TODO(yuanbohan): code coverage with pytest-cov
- name: Test with pytest
env:
GREPTIMEAI_HOST: ${{ secrets.GREPTIMEAI_HOST }}
GREPTIMEAI_USERNAME: ${{ secrets.GREPTIMEAI_USERNAME }}
GREPTIMEAI_PASSWORD: ${{ secrets.GREPTIMEAI_PASSWORD }}
GREPTIMEAI_DATABASE: ${{ secrets.GREPTIMEAI_DATABASE }}
GREPTIMEAI_TOKEN: ${{ secrets.GREPTIMEAI_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pytest tests/ -v
- 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
- name: shared-steps
uses: ./.github/workflows/shared-steps.yml

concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/shared-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: shared-steps

runs:
steps:
- 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
# TODO(yuanbohan): code coverage with pytest-cov
- name: Test with pytest
env:
GREPTIMEAI_HOST: ${{ secrets.GREPTIMEAI_HOST }}
GREPTIMEAI_USERNAME: ${{ secrets.GREPTIMEAI_USERNAME }}
GREPTIMEAI_PASSWORD: ${{ secrets.GREPTIMEAI_PASSWORD }}
GREPTIMEAI_DATABASE: ${{ secrets.GREPTIMEAI_DATABASE }}
GREPTIMEAI_TOKEN: ${{ secrets.GREPTIMEAI_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
pytest tests/ -v
- 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

0 comments on commit 60ef519

Please sign in to comment.