Skip to content
Open
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
26 changes: 23 additions & 3 deletions lint-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ inputs:
python-version:
description: "Python version that should be installed"
default: "3.10"
package-manager:
description: "Package manager to use. Default is 'poetry'."
default: "poetry"
poetry-version:
description: "Use a specific poetry version. By default the latest release is used."
uv-version:
description: "Use a specific uv version. By default the latest release is used."
cache:
description: "Cache dependencies by setting it to 'true'. Leave unset or set to an other string then 'true' to disable the cache."
cache-dependency-path:
Expand Down Expand Up @@ -38,7 +43,8 @@ branding:
runs:
using: "composite"
steps:
- name: Install poetry
- if: ${{ inputs.package-manager == 'poetry' }}
name: Install poetry
uses: greenbone/actions/poetry@v3
with:
python-version: ${{ inputs.python-version }}
Expand All @@ -48,11 +54,25 @@ runs:
cache-poetry-installation: ${{ inputs.cache-poetry-installation }}
install-dependencies: ${{ inputs.install-dependencies }}
working-directory: ${{ inputs.working-directory }}
- run: poetry run ${{ inputs.formatter }} ${{ inputs.packages }}
- if: ${{ inputs.package-manager == 'uv' }}
name: Install uv
uses: greenbone/actions/uv@v3
with:
python-version: ${{ inputs.python-version }}
uv-version: ${{ inputs.uv-version }}
enable-cache: ${{ inputs.cache }}
cache-dependency-glob: ${{ inputs.cache-dependency-path }}
working-directory: ${{ inputs.working-directory }}
- if: ${{ inputs.package-manager == 'uv' && inputs.install-dependencies == 'true' }}
name: Install dependencies with uv
run: uv sync --locked --all-extras --dev
shell: bash
working-directory: ${{ inputs.working-directory }}
- run: ${{ inputs.package-manager }} run ${{ inputs.formatter }} ${{ inputs.packages }}
shell: bash
name: Check with ${{ inputs.formatter }}
working-directory: ${{ inputs.working-directory }}
- run: poetry run ${{ inputs.linter }} ${{ inputs.packages }}
- run: ${{ inputs.package-manager }} run ${{ inputs.linter }} ${{ inputs.packages }}
shell: bash
name: Check with ${{ inputs.linter }}
working-directory: ${{ inputs.working-directory }}
Loading