Skip to content

Commit f3b3ec3

Browse files
committed
Use reusable PHP test workflow for icinga/github-actions
1 parent fa23e86 commit f3b3ec3

File tree

1 file changed

+5
-74
lines changed

1 file changed

+5
-74
lines changed

.github/workflows/php.yml

Lines changed: 5 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,10 @@
1-
name: PHP Tests
1+
name: PHP
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- release/*
84
pull_request:
5+
workflow_dispatch:
96

107
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
33-
34-
- name: PHP Lint
35-
if: ${{ ! cancelled() }}
36-
run: ./vendor/bin/phplint -n --exclude={^vendor/.*} -- .
37-
38-
- name: PHP CodeSniffer
39-
if: ${{ ! cancelled() }}
40-
run: phpcs -wps --colors
41-
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
8+
php:
9+
name: PHP
10+
uses: icinga/github-actions/.github/workflows/php.yml@8224454836d2587e357c4012a5e302e47711cd28

0 commit comments

Comments
 (0)