Skip to content

Commit 82cc498

Browse files
committed
Replace super-linter with a reusable workflow
1 parent e81ad90 commit 82cc498

File tree

3 files changed

+46
-23
lines changed

3 files changed

+46
-23
lines changed

.github/workflows/php.yml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@ on: # yamllint disable-line rule:truthy
1414
workflow_dispatch:
1515

1616
jobs:
17+
phplinter:
18+
name: 'PHP-Linter'
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
php-version: ['8.1', '8.2', '8.3', '8.4']
23+
24+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected]
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
1728
linter:
18-
name: Linter
19-
runs-on: ['ubuntu-latest']
29+
name: 'Linter'
30+
strategy:
31+
fail-fast: false
2032

21-
steps:
22-
- uses: actions/checkout@v3
23-
with:
24-
fetch-depth: 0
25-
26-
- name: Lint Code Base
27-
uses: super-linter/super-linter/slim@v6
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30-
LINTER_RULES_PATH: 'tools/linters'
31-
LOG_LEVEL: NOTICE
32-
VALIDATE_ALL_CODEBASE: true
33-
VALIDATE_CSS: true
34-
VALIDATE_JAVASCRIPT_ES: true
35-
VALIDATE_JSON: true
36-
VALIDATE_PHP_BUILTIN: true
37-
VALIDATE_YAML: true
38-
VALIDATE_XML: true
39-
VALIDATE_GITHUB_ACTIONS: true
33+
uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/[email protected]
34+
with:
35+
enable_eslinter: true
36+
enable_jsonlinter: true
37+
enable_stylelinter: false
38+
enable_yamllinter: true
4039

4140
quality:
4241
name: Quality control
42+
needs: [unit-tests-linux]
4343
runs-on: [ubuntu-latest]
4444

4545
steps:
@@ -108,7 +108,9 @@ jobs:
108108
109109
security:
110110
name: Security checks
111+
needs: [unit-tests-linux]
111112
runs-on: [ubuntu-latest]
113+
112114
steps:
113115
- name: Setup PHP, with composer and extensions
114116
# https://github.com/shivammathur/setup-php
@@ -150,7 +152,7 @@ jobs:
150152
unit-tests-linux:
151153
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
152154
runs-on: ${{ matrix.operating-system }}
153-
needs: [linter, quality, security]
155+
needs: [phplinter, linter]
154156
strategy:
155157
fail-fast: false
156158
matrix:
@@ -215,7 +217,7 @@ jobs:
215217
unit-tests-windows:
216218
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
217219
runs-on: ${{ matrix.operating-system }}
218-
needs: [linter, quality, security]
220+
needs: [phplinter, linter]
219221
strategy:
220222
fail-fast: true
221223
matrix:

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

tools/linters/eslint.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// eslint.config.js
2+
const { defineConfig } = require("eslint/config");
3+
4+
module.exports = defineConfig([
5+
{
6+
languageOptions: {
7+
ecmaVersion: 2015,
8+
sourceType: "module"
9+
},
10+
files: [
11+
"**.js"
12+
],
13+
}
14+
]);

0 commit comments

Comments
 (0)