Skip to content

Commit a403293

Browse files
authored
GitHub Actions: Use new PHP workflows (#172)
Switch to the new PHP workflows, which combine linting, static analysis, and unit testing. Remove `phpcs.xml`, as the new workflow provides its own `phpcs` configuration (using sane defaults).
2 parents 9f664aa + 6a09a15 commit a403293

3 files changed

Lines changed: 7 additions & 54 deletions

File tree

.github/workflows/php.yml

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,14 @@
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
9+
workflow_dispatch:
1110

1211
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: [ '8.2', '8.3' ]
21-
os: [ 'ubuntu-latest' ]
22-
23-
steps:
24-
- name: Checkout code base
25-
uses: actions/checkout@v6
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: |
35-
composer require -n --no-progress overtrue/phplint
36-
git clone --depth 1 https://github.com/Icinga/icingaweb2.git vendor/icingaweb2
37-
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git vendor/icinga-php-library
38-
git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git vendor/icinga-php-thirdparty
39-
40-
- name: PHP Lint
41-
if: ${{ ! cancelled() }}
42-
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .
43-
44-
- name: PHP CodeSniffer
45-
if: ${{ ! cancelled() }}
46-
run: phpcs -wps --colors
12+
php:
13+
name: PHP
14+
uses: Icinga/github-actions/.github/workflows/php.yml@main

library/Kubernetes/Web/Widget/HighlightDelta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(
1919
protected string $short,
2020
?Attributes $attributes = null
2121
) {
22-
if (!str_contains($long, $short)) {
22+
if (! str_contains($long, $short)) {
2323
throw new InvalidArgumentException('Short name must be part of long name');
2424
}
2525

phpcs.xml

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

0 commit comments

Comments
 (0)