Skip to content

Commit

Permalink
GH Actions WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bsbodden committed Apr 5, 2024
1 parent 0906a60 commit 0a45659
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 180 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
# Starting new jobs is also relatively slow,
# so linting on fewer versions makes CI faster.
python-version:
- "3.8"
- "3.9"
- "3.11"

steps:
Expand All @@ -30,19 +30,17 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev,all]
poetry install
- name: check-sort-import
run: |
make check-sort-imports
poetry run check-sort-imports
- name: check-black-format
run: |
make check-format
- name: check-mypy
run: |
make mypy
poetry run check-format
# - name: check-mypy
# run: |
# poetry run mypy
30 changes: 16 additions & 14 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
connection: ['hiredis', 'plain']
redis-stack-version: ['6.2.6-v9', 'latest']

services:
redis:
image: redis/redis-stack-server:${{matrix.redis-stack-version}}
ports:
- 6379:6379
# services:
# redis:
# image: redis/redis-stack-server:${{matrix.redis-stack-version}}
# ports:
# - 6379:6379

steps:
- uses: actions/checkout@v2
Expand All @@ -33,20 +33,21 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev,all]
poetry install
- name: Install hiredis if needed
if: matrix.connection == 'hiredis'
run: |
pip install hiredis
- name: Start Redis
run: |
REDIS_URL=redis://localhost:6379
echo REDIS_URL=$REDIS_URL >> $GITHUB_ENV
# - name: Start Redis
# run: |
# REDIS_URL=redis://localhost:6379
# echo REDIS_URL=$REDIS_URL >> $GITHUB_ENV

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
Expand All @@ -61,12 +62,12 @@ jobs:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
run: |
make test-cov
poetry run test-cov
- name: Run tests
if: matrix.connection != 'plain' || matrix.redis-stack-version != 'latest'
run: |
SKIP_VECTORIZERS=True make test-cov
SKIP_VECTORIZERS=True poetry run test-cov
- name: Run notebooks
if: matrix.connection == 'plain' && matrix.redis-stack-version == 'latest'
Expand All @@ -79,7 +80,8 @@ jobs:
cd docs/ && treon -v --exclude="./examples/openai_qna.ipynb"
- name: Publish coverage results
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage
fail_ci_if_error: true
Loading

0 comments on commit 0a45659

Please sign in to comment.