Skip to content

Commit e4ce6a0

Browse files
authored
GitHub Actions: Use new PHP workflow (#344)
This PR switches to the new PHP workflow, which combines linting, static analysis, and unit testing. `phpcs.xml` file has been removed because the new workflow provides a default config for it and the file did not contain any special configurations anyway. Code style corrections were made to comply with the latest PSR coding standards. In addition, allow GitHub Actions workflow to run for every pull request instead of only main-based pull requests.
2 parents 563b322 + bcac72e commit e4ce6a0

4 files changed

Lines changed: 11 additions & 66 deletions

File tree

.github/workflows/php.yml

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,18 @@
1-
name: PHP Tests
1+
name: CI
22

33
on:
44
push:
55
branches:
66
- main
7-
- release/*
7+
- support/*
88
pull_request:
9-
branches:
10-
- main
119

1210
jobs:
13-
lint:
14-
name: Static analysis for php ${{ matrix.php }} on ${{ matrix.os }}
15-
runs-on: ${{ matrix.os }}
16-
17-
strategy:
18-
fail-fast: false
19-
matrix:
20-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
21-
os: ['ubuntu-latest']
22-
23-
steps:
24-
- name: Checkout code base
25-
uses: actions/checkout@v4
26-
27-
- name: Setup PHP
28-
uses: shivammathur/setup-php@v2
29-
with:
30-
php-version: ${{ matrix.php }}
31-
tools: phpcs
32-
33-
- name: Setup dependencies
34-
run: composer require -n --no-progress overtrue/phplint
35-
36-
- name: PHP Lint
37-
if: ${{ ! cancelled() }}
38-
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .
39-
40-
- name: PHP CodeSniffer
41-
if: ${{ ! cancelled() }}
42-
run: phpcs -wps --colors
11+
php:
12+
name: PHP
13+
uses: Icinga/github-actions/.github/workflows/php.yml@main
14+
with:
15+
dependencies: |
16+
{
17+
"./vendor/icingaweb2-modules/icingadb" : "https://github.com/Icinga/icingadb-web.git"
18+
}

.github/workflows/phpstan.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

library/Graphite/Web/Widget/GraphImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function render()
9090
$allVars = [];
9191

9292
foreach ($template->getCurves() as $curveName => $curve) {
93-
if (!isset($metrics[$curveName])) {
93+
if (! isset($metrics[$curveName])) {
9494
continue;
9595
}
9696

phpcs.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)