1- name : PHP Tests
1+ name : PHP test
22
33on :
4- push :
4+ pull_request :
55 branches :
66 - main
7- - release/*
8- pull_request :
9-
10- jobs :
11- lint :
12- name : Static analysis for php ${{ matrix.php }} on ${{ matrix.os }}
13- runs-on : ${{ matrix.os }}
14-
15- strategy :
16- fail-fast : false
17- matrix :
18- php : ['8.2', '8.3', '8.4']
19- os : ['ubuntu-latest']
20-
21- steps :
22- - name : Checkout code base
23- uses : actions/checkout@v4
24-
25- - name : Setup PHP
26- uses : shivammathur/setup-php@v2
27- with :
28- php-version : ${{ matrix.php }}
29- tools : phpcs
30-
31- - name : Setup dependencies
32- run : composer require -n --no-progress overtrue/phplint
7+ workflow_dispatch :
338
34- - name : PHP Lint
35- if : ${{ ! cancelled() }}
36- run : ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .
379
38- - name : PHP CodeSniffer
39- if : ${{ ! cancelled() }}
40- run : phpcs -wps --colors
4110
42- test :
43- name : Unit tests with php ${{ matrix.php }} on ${{ matrix.os }}
44- runs-on : ${{ matrix.os }}
45-
46- env :
47- phpunit-version : 8.5
48-
49- strategy :
50- fail-fast : false
51- matrix :
52- php : ['8.2', '8.3', '8.4']
53- os : ['ubuntu-latest']
54-
55- steps :
56- - name : Checkout code base
57- uses : actions/checkout@v4
58-
59- - name : Setup PHP
60- uses : shivammathur/setup-php@v2
61- with :
62- php-version : ${{ matrix.php }}
63- tools : phpunit:${{ matrix.phpunit-version || env.phpunit-version }}
64-
65- - name : Setup Icinga Web
66- run : |
67- git clone --depth 1 https://github.com/Icinga/icingaweb2.git _icingaweb2
68- ln -s `pwd` _icingaweb2/modules/icingadb
69-
70- - name : Setup Libraries
71- run : |
72- mkdir _libraries
73- git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-library.git _libraries/ipl
74- git clone --depth 1 -b snapshot/nightly https://github.com/Icinga/icinga-php-thirdparty.git _libraries/vendor
75-
76- - name : PHPUnit
77- env :
78- ICINGAWEB_LIBDIR : _libraries
79- run : phpunit --verbose --bootstrap _icingaweb2/test/php/bootstrap.php
11+ jobs :
12+ php :
13+ name : PHP Testing
14+ uses : icinga/github-actions/.github/workflows/php.yml@php-workflow
0 commit comments