-
Notifications
You must be signed in to change notification settings - Fork 31
53 lines (45 loc) · 1.5 KB
/
php.yml
File metadata and controls
53 lines (45 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: "CI"
on:
pull_request:
paths:
- "**.php"
- "bin/posthog"
- "phpcs.xml"
- "phpunit.xml"
- ".github/workflows/php.yml"
jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.2, 8.3, 8.4, 8.5]
steps:
- uses: actions/checkout@v6
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
with:
php-version: ${{ matrix.php-version }}
extensions: xdebug
tools: composer, phpunit
- name: Install Dependencies
run: composer install --prefer-dist --no-progress
- name: Run PHPUnit Tests
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --bootstrap vendor/autoload.php --configuration phpunit.xml --coverage-text
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # important!
# we may use whatever way to install phpcs, just specify the path on the next step
# however, curl seems to be the fastest
- name: Install PHP_CodeSniffer
run: |
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar --version
- uses: tinovyatkin/action-php-codesniffer@0043b33b3629611c37e8bc7ee8a4e061dc9a7ea2 # v1
with:
files: "**.php" # you may customize glob as needed
phpcs_path: php phpcs.phar
standard: phpcs.xml
scope: "file"