-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 2.61 KB
/
php.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Run PHP Tests and Code Quality Tools
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
# Also run every Sunday at midnight
- cron: '0 0 * * 0'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [8.3, 8.2, 8.1, 8.0, 7.4]
# prefer-lowest is causing unit tests to fail when php 7.2 is run against PHPunit 7.x,
# PHPUnit 8.x is the latest stable release that supports PHP 7.2 and that runs fine
# dependency-version: [prefer-lowest, prefer-stable]
dependency-version: [prefer-stable]
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-20.04
php: 7.4
- os: ubuntu-20.04
php: 8.0
- os: ubuntu-20.04
php: 8.1
- os: ubuntu-22.04
php: 8.1
- os: ubuntu-22.04
php: 8.2
- os: ubuntu-22.04
php: 8.3
#exclude:
#- os: ubuntu-20.04
# php: 7.3
name: PHP-${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: pcre.jit=0, pcre.backtrack_limit=9999999, pcre.recursion_limit=9999999
coverage: xdebug
- name: PHP version
run: php -v
- name: Composer version
run: composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install Dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md
- name: Run PHPUnit Test Suite
run: vendor/bin/phpunit
- name: Upload coverage results to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
- name: Run Rector
# Run rector for PHP 7.3+ but not 8.0
#if: matrix.php == '7.4'
run: vendor/bin/rector process src --dry-run
continue-on-error: true
- name: Run Psalm
# Run psalm for PHP 7.4 & 8.0 but not 7.2 & 7.3, psalm is currently blowing up with PHP 7.2 & 7.3
# if: matrix.php != '7.3'
run: vendor/bin/psalm
continue-on-error: true