diff --git a/.github/workflows/poetry-djlint.yml b/.github/workflows/poetry-djlint.yml new file mode 100644 index 0000000..9a2d755 --- /dev/null +++ b/.github/workflows/poetry-djlint.yml @@ -0,0 +1,38 @@ +#SPDX-FileCopyrightText: 2023 Birger Schacht +#SPDX-License-Identifier: MIT +name: Run djlint linter via poetry + +on: + workflow_call: + inputs: + python-version: + required: false + type: string + default: "3.11" + src: + required: true + type: string + options: + required: false + type: string + default: "--check" + +jobs: + djlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # for poetry caching, we have to install poetry before setting up python + - name: Install poetry + run: pipx install poetry + - uses: actions/setup-python@v4 + with: + cache: 'poetry' + cache-dependency-path: "pyproject.toml" + python-version: ${{ inputs.python-version }} + - name: Install dev dependencies + run: | + poetry install --no-root --no-directory --only dev + - name: Run djlint + run: | + poetry run djlint ${{inputs.options}} ${{inputs.src}}