Skip to content

Commit

Permalink
poetry actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Jun 11, 2024
1 parent e3544c6 commit 98d9021
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ jobs:
- "3.11"

steps:
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.1"

- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -102,7 +97,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
cache-dependency-path: ./api/poetry.lock
cache-dependency-path: |
./api/pyproject.toml
- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.1"

- name: Poetry check
run: poetry check -C api
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/db-migration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache: 'poetry'
cache-dependency-path: |
./api/requirements.txt
./api/pyproject.toml
- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.1"

- name: Install dependencies
run: pip install -r ./api/requirements.txt
run: poetry install -C api

- name: Set up Middleware
uses: hoverkraft-tech/[email protected]
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ jobs:
with:
python-version: '3.10'

- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.1"

- name: Python dependencies
if: steps.changed-files.outputs.any_changed == 'true'
run: pip install ruff dotenv-linter
run: poetry install --only lint

- name: Ruff check
if: steps.changed-files.outputs.any_changed == 'true'
Expand Down
1 change: 1 addition & 0 deletions api/migrations/README
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Single-database configuration for Flask.

4 changes: 4 additions & 0 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,7 @@ pytest = "~8.1.1"
pytest-benchmark = "~4.0.0"
pytest-env = "~1.1.3"
pytest-mock = "~3.14.0"

[tool.poetry.group.lint.dependencies]
ruff = "~0.4.8"
dotenv-linter = "~0.5.0"

0 comments on commit 98d9021

Please sign in to comment.