Skip to content

Commit

Permalink
Add poetry to django.yaml as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Clue88 committed Jan 14, 2024
1 parent f98f776 commit b5916c9
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/django.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
required: False
type: boolean
default: True
# Dependency manager config
dependencyManager:
required: False
description: "Dependency manager to use (e.g., pipenv, poetry)"
default: "pipenv"
jobs:
django-check:
name: Django Check
Expand All @@ -45,21 +50,28 @@ jobs:
cd ${{ inputs.path }}
pip install pipenv
pipenv install --deploy --dev
if: ${{ inputs.dependencyManager == "pipenv" }}
- name: Install Poetry
uses: snok/install-poetry@v1
if: ${{ inputs.dependencyManager == "poetry" }}
- name: Install Dependencies (poetry)
run: poetry install --no-root
if: ${{ inputs.dependencyManager == "poetry" }}
- name: Lint (flake8)
run: |-
cd ${{ inputs.path }}
pipenv run flake8 .
${{ inputs.dependencyManager }} run flake8 .
if: ${{ inputs.flake }}
- name: Lint (black)
run: |-
cd ${{ inputs.path }}
pipenv run black --check .
${{ inputs.dependencyManager }} run black --check .
if: ${{ inputs.black }}
- name: Test (run in parallel)
run: |-
cd ${{ inputs.path }}
pipenv run coverage run --concurrency=multiprocessing manage.py test --settings=${{ inputs.projectName }}.settings.ci --parallel
pipenv run coverage combine
${{ inputs.dependencyManager }} run coverage run --concurrency=multiprocessing manage.py test --settings=${{ inputs.projectName }}.settings.ci --parallel
${{ inputs.dependencyManager }} run coverage combine
container:
image: python:${{ inputs.pythonVersion }}
env:
Expand Down

0 comments on commit b5916c9

Please sign in to comment.