From afcd423c847343b050b3c73aebc4161ea39bb299 Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Tue, 20 Jun 2023 12:08:22 +0200 Subject: [PATCH] feat(poetry-djlint): introduce poetry-djlint workflow --- .github/workflows/poetry-djlint.yml | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/poetry-djlint.yml 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}}