From eaf26a2ec37c3b7a0d78fd101d292384568a289a Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 1 May 2023 04:07:29 +0200 Subject: [PATCH] add twig-lint Signed-off-by: Simon L --- .github/workflows/twig-lint.yml | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/twig-lint.yml diff --git a/.github/workflows/twig-lint.yml b/.github/workflows/twig-lint.yml new file mode 100644 index 00000000..0652df87 --- /dev/null +++ b/.github/workflows/twig-lint.yml @@ -0,0 +1,55 @@ +name: Twig Lint + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +concurrency: + group: lint-twig-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + twig-lint: + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ["8.1"] + + name: twig-lint + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: none + + - name: twig lint + run: | + cd php + composer require sserbin/twig-linter:@dev --no-progress --dev + composer install + chmod +x ./vendor/bin/twig-linter + ./vendor/bin/twig-linter lint ./templates + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: twig-lint + + if: always() + + name: twig-lint-summary + + steps: + - name: Summary status + run: if ${{ needs.twig-lint.result != 'success' && needs.twig-lint.result != 'skipped' }}; then exit 1; fi