-
Notifications
You must be signed in to change notification settings - Fork 86
48 lines (41 loc) · 1.5 KB
/
tests.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
name: PHP Composer
#whenever master has a PR or is pushed to
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
run:
runs-on: ubuntu-18.04
strategy:
#for each of the following versions of PHP, with and without --prefer-lowest
matrix:
php-versions: [ '7.2.5', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
composer-options: [ '', '--prefer-lowest' ]
#set the name for each job
name: PHP ${{ matrix.php-versions }}
steps:
#sets up the correct version of PHP with necessary config options
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: memory_limit=4G, phar.readonly=false
#checkout the codebase from github
- name: Checkout codebase
uses: actions/checkout@v3
#run composer
- name: Composer install
run: composer install
#run tests
- name: Run test suite
run: vendor/bin/phpunit
#php 8.x requirements
- if: ${{ matrix.php-versions >= '8.0' && matrix.composer-options != '' }}
name: PHP 8.x
run: composer require --dev phpunit/phpunit "^9.5" --no-interaction --prefer-source --with-all-dependencies
#php 8.1+ requirements
- if: ${{ matrix.php-versions >= '8.1' && matrix.composer-options != '' }}
name: PHP 8.1+
run: composer require --dev guzzlehttp/guzzle "^7.4.5" --no-interaction --prefer-source --with-all-dependencies