Skip to content

Commit 4ab82f4

Browse files
committed
Replace bash-scripts with linter-actions
1 parent 051c5de commit 4ab82f4

File tree

2 files changed

+27
-33
lines changed

2 files changed

+27
-33
lines changed

.github/workflows/php.yml

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
basic-tests:
11-
name: Syntax and unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}
11+
name: Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}
1212
runs-on: ${{ matrix.operating-system }}
1313
strategy:
1414
fail-fast: false
@@ -59,9 +59,6 @@ jobs:
5959
- name: Install Composer dependencies
6060
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
6161

62-
- name: Syntax check PHP
63-
run: bash vendor/bin/check-syntax-php.sh
64-
6562
- name: Decide whether to run code coverage or not
6663
if: ${{ matrix.php-versions != '8.3' || matrix.operating-system != 'ubuntu-latest' }}
6764
run: |
@@ -115,38 +112,28 @@ jobs:
115112
- name: Security check for updated dependencies
116113
uses: symfonycorp/security-checker-action@v5
117114

118-
sanity-check:
119-
name: Sanity checks
120-
runs-on: [ubuntu-latest]
121-
122-
steps:
123-
- name: Setup PHP, with composer and extensions
124-
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
125-
with:
126-
php-version: '8.3'
127-
extensions: mbstring, xml
128-
coverage: none
129-
130-
- name: Setup problem matchers for PHP
131-
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
132-
133-
- uses: actions/checkout@v3
115+
phplinter:
116+
name: 'PHP-Linter'
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
php-version: ['8.3', '8.4', '8.5']
134121

135-
- name: Cache composer dependencies
136-
uses: actions/cache@v3
137-
with:
138-
path: $COMPOSER_CACHE
139-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
140-
restore-keys: ${{ runner.os }}-composer-
122+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1.11.0
123+
with:
124+
php-version: ${{ matrix.php-version }}
141125

142-
- name: Install Composer dependencies
143-
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
126+
linter:
127+
name: 'Linter'
128+
strategy:
129+
fail-fast: false
144130

145-
- name: Syntax check YAML / XML / JSON
146-
run: |
147-
bash vendor/bin/check-syntax-yaml.sh
148-
bash vendor/bin/check-syntax-xml.sh
149-
bash vendor/bin/check-syntax-json.sh
131+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_linter.yml@v1.11.0
132+
with:
133+
enable_eslinter: false
134+
enable_jsonlinter: true
135+
enable_stylelinter: false
136+
enable_yamllinter: true
150137

151138
quality:
152139
name: Quality control

tools/linters/.yaml-lint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
extends: default
4+
5+
rules:
6+
line-length:
7+
max: 120

0 commit comments

Comments
 (0)