Skip to content

Commit

Permalink
chore(ci): bring back poetry cache to speed up CI jobs (langgenius#10347
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bowenliang123 authored and JunXu01 committed Nov 9, 2024
1 parent 6d9ebfa commit 768ee39
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- api/**
- docker/**
- .github/workflows/api-tests.yml

concurrency:
group: api-tests-${{ github.head_ref || github.run_id }}
Expand All @@ -27,16 +28,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Poetry
uses: abatilo/actions-poetry@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache-dependency-path: |
api/pyproject.toml
api/poetry.lock
- name: Install Poetry
uses: abatilo/actions-poetry@v3
cache: poetry
cache-dependency-path: api/poetry.lock

- name: Check Poetry lockfile
run: |
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
run: sh .github/workflows/expose_service_ports.sh

- name: Set up Sandbox
uses: hoverkraft-tech/[email protected].0
uses: hoverkraft-tech/[email protected].2
with:
compose-file: |
docker/docker-compose.middleware.yaml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/db-migration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cp middleware.env.example middleware.env
- name: Set up Middlewares
uses: hoverkraft-tech/[email protected].0
uses: hoverkraft-tech/[email protected].2
with:
compose-file: |
docker/docker-compose.middleware.yaml
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ jobs:
with:
files: api/**

- name: Install Poetry
if: steps.changed-files.outputs.any_changed == 'true'
uses: abatilo/actions-poetry@v3

- name: Set up Python
uses: actions/setup-python@v5
if: steps.changed-files.outputs.any_changed == 'true'
with:
python-version: '3.10'

- name: Install Poetry
if: steps.changed-files.outputs.any_changed == 'true'
uses: abatilo/actions-poetry@v3

- name: Python dependencies
if: steps.changed-files.outputs.any_changed == 'true'
run: poetry install -C api --only lint
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/vdb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
paths:
- api/core/rag/datasource/**
- docker/**
- .github/workflows/vdb-tests.yml

concurrency:
group: api-tests-${{ github.head_ref || github.run_id }}
group: vdb-tests-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
Expand All @@ -27,16 +28,15 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Poetry
uses: abatilo/actions-poetry@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache-dependency-path: |
api/pyproject.toml
api/poetry.lock
- name: Install Poetry
uses: abatilo/actions-poetry@v3
cache: poetry
cache-dependency-path: api/poetry.lock

- name: Check Poetry lockfile
run: |
Expand All @@ -55,7 +55,7 @@ jobs:
run: sh .github/workflows/expose_service_ports.sh

- name: Set up Vector Stores (Weaviate, Qdrant, PGVector, Milvus, PgVecto-RS, Chroma, MyScale, ElasticSearch, Couchbase)
uses: hoverkraft-tech/[email protected].0
uses: hoverkraft-tech/[email protected].2
with:
compose-file: |
docker/docker-compose.yaml
Expand Down
4 changes: 2 additions & 2 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
1. Install dependencies for both the backend and the test environment

```bash
poetry install --with dev
poetry install -C api --with dev
```

2. Run the tests locally with mocked system environment variables in `tool.pytest_env` section in `pyproject.toml`

```bash
cd ../
poetry run -C api bash dev/pytest/pytest_all_tests.sh
```


0 comments on commit 768ee39

Please sign in to comment.