|
3 | 3 | on: # yamllint disable-line rule:truthy |
4 | 4 | workflow_call: |
5 | 5 | inputs: |
6 | | - enable_phplinter: |
7 | | - description: 'Enable the PHP-Linter for this repository' |
8 | | - type: boolean |
9 | | - required: false |
10 | | - default: false |
11 | | - phplinter-versions: |
12 | | - description: 'The PHP-version to use for linting' |
13 | | - type: string |
14 | | - required: false |
15 | | - default: '["8.1", "8.2", "8.3", "8.4"]' |
16 | | - |
17 | 6 | enable_eslinter: |
18 | 7 | description: 'Enable the ES-Linter for this repository' |
19 | 8 | type: boolean |
@@ -69,64 +58,7 @@ on: # yamllint disable-line rule:truthy |
69 | 58 | required: false |
70 | 59 | default: ${{ github.ref }} |
71 | 60 |
|
72 | | -env: |
73 | | - php_supported_versions: '["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]' |
74 | | - |
75 | 61 | jobs: |
76 | | - phplinter: |
77 | | - if: inputs.enable_phplinter == true |
78 | | - runs-on: ubuntu-latest |
79 | | - |
80 | | - strategy: |
81 | | - matrix: |
82 | | - php_version: ${{ fromJSON(inputs.phplinter-versions) }} |
83 | | - |
84 | | - steps: |
85 | | - - name: Supported version check |
86 | | - if: contains(fromJSON(env.php_supported_versions), matrix.php_version) == false |
87 | | - run: exit 1 |
88 | | - |
89 | | - - name: Checkout Code |
90 | | - uses: actions/checkout@v4 |
91 | | - with: |
92 | | - fetch-depth: 0 |
93 | | - repository: ${{ inputs.repository }} |
94 | | - ref: ${{ inputs.ref }} |
95 | | - |
96 | | - - name: Setup PHP runtime |
97 | | - uses: shivammathur/setup-php@v2 |
98 | | - with: |
99 | | - tools: phive |
100 | | - php-version: ${{ matrix.php_version }} |
101 | | - coverage: "none" |
102 | | - |
103 | | - - name: Install overtrue/phplint (v3.4) |
104 | | - if: matrix.php_version == '7.4' |
105 | | - run: | |
106 | | - phive install overtrue/phplint@~3.4.0 --force-accept-unsigned --target ./bin |
107 | | -
|
108 | | - - name: Install overtrue/phplint (v4.5) |
109 | | - if: matrix.php_version == '8.0' |
110 | | - run: | |
111 | | - phive install overtrue/phplint@~4.5.0 --force-accept-unsigned --target ./bin |
112 | | -
|
113 | | - - name: Install overtrue/phplint (v9.4) |
114 | | - if: matrix.php_version == '8.1' |
115 | | - run: | |
116 | | - phive install overtrue/phplint@~9.4.0 --force-accept-unsigned --target ./bin |
117 | | -
|
118 | | - - name: Install overtrue/phplint (v9.5) |
119 | | - if: | |
120 | | - matrix.php_version != '7.4' |
121 | | - && matrix.php_version != '8.0' |
122 | | - && matrix.php_version != '8.1' |
123 | | - run: | |
124 | | - phive install overtrue/phplint@~9.5.0 --force-accept-unsigned --target ./bin |
125 | | -
|
126 | | - - name: Lint PHP files |
127 | | - run: | |
128 | | - ./bin/phplint --no-cache --no-progress -v |
129 | | -
|
130 | 62 | ecmascript-linter: |
131 | 63 | if: inputs.enable_eslinter == true |
132 | 64 | runs-on: ubuntu-latest |
|
0 commit comments