mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-11-11 01:13:41 +08:00
Merge pull request #2442 from nextcloud/enh/noid/twig-lint
add twig-lint
This commit is contained in:
commit
b349135dfb
1 changed files with 55 additions and 0 deletions
55
.github/workflows/twig-lint.yml
vendored
Normal file
55
.github/workflows/twig-lint.yml
vendored
Normal file
|
@ -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
|
Loading…
Reference in a new issue