Skip to content

Commit c49feda

Browse files
Support PHP 7.1 and 8.0
1 parent 5a6aab3 commit c49feda

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-4
lines changed

Diff for: .github/workflows/test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
tests:
9+
name: PHP ${{ matrix.php }}
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
15+
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v2
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
extensions: curl
25+
tools: composer:v2
26+
coverage: none
27+
28+
- name: Setup Problem Matchers
29+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
30+
31+
- name: Install PHP 7 Dependencies
32+
uses: nick-invision/retry@v1
33+
with:
34+
timeout_minutes: 5
35+
max_attempts: 5
36+
command: composer update --no-interaction --no-progress
37+
if: "matrix.php != '8.0'"
38+
39+
- name: Install PHP 8 Dependencies
40+
uses: nick-invision/retry@v1
41+
with:
42+
timeout_minutes: 5
43+
max_attempts: 5
44+
command: |
45+
composer require "phpunit/phpunit:^9.3" --no-update
46+
composer update --no-interaction --no-progress --ignore-platform-req=php
47+
if: "matrix.php == '8.0'"
48+
49+
- name: Execute PHPUnit
50+
run: vendor/bin/phpunit

Diff for: composer.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
}
1818
],
1919
"require": {
20-
"php" : "^7.2"
20+
"php" : "^7.1 || ^8.0"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit" : "^8.5 || ^9.3"
23+
"phpunit/phpunit" : "^7.5.15 || ^8.5 || ^9.3"
2424
},
2525
"autoload": {
2626
"psr-4": {
@@ -38,6 +38,9 @@
3838
}
3939
},
4040
"config": {
41+
"preferred-install": "dist",
4142
"sort-packages": true
42-
}
43+
},
44+
"minimum-stability": "dev",
45+
"prefer-stable": true
4346
}

Diff for: phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
>
1010
<testsuites>
1111
<testsuite name="AllTests">
12-
<directory>tests</directory>
12+
<directory>tests/</directory>
1313
</testsuite>
1414
</testsuites>
1515
<filter>

0 commit comments

Comments
 (0)