Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions django-check/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ inputs:
required: False
description: "whether to use black for linting"
default: "true"
# Dependency manager config
dependencyManager:
required: False
description: "Dependency manager to use (e.g., pipenv, poetry)"
default: "pipenv"

runs:
using: "composite"
Expand All @@ -34,30 +39,39 @@ runs:
with:
path: ~/.local/share/virtualenvs
key: v0-${{ hashFiles('${{ inputs.path }}/Pipfile.lock') }}
- name: Install Dependencies
- name: Install Dependencies (pipenv)
shell: bash
continue-on-error: true
run: |-
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)
shell: bash
continue-on-error: true
run: poetry install --no-root
if: ${{ inputs.dependencyManager == "poetry" }}
- name: Test (run in parallel)
shell: bash
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
- name: Lint (flake8)
shell: bash
run: |-
cd ${{ inputs.path }}
pipenv run flake8 .
${{ inputs.dependencyManager }} run flake8 .
if: ${{ inputs.flake }}
- name: Lint (black)
shell: bash
run: |-
cd ${{ inputs.path }}
pipenv run black --check . || pipenv run black --diff .
${{ inputs.dependencyManager }} run black --check . || ${{ inputs.dependencyManager }} run black --diff .
if: ${{ inputs.black }}
container:
image: python:${{ inputs.pythonVersion }}