-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (56 loc) · 2.45 KB
/
tests.yaml
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
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }}
runs-on: ubuntu-18.04
strategy:
matrix:
php-version:
- 7.3
- 7.4
- 8.0
- 8.1
dependencies: [highest]
include:
- php-version: 7.2
dependencies: lowest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2
- name: Install Composer dependencies (PHP 7 ${{ matrix.dependencies }})
if: ${{ matrix.php-version < '8.0' }}
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: --prefer-dist --prefer-stable
# For PHP 8.0+, we need to install with ignore platform reqs as PHPUnit 7 is still used.
- name: Install Composer dependencies (PHP 8 ${{ matrix.dependencies }})
if: ${{ matrix.php-version >= '8.0' }}
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: --prefer-dist --prefer-stable --ignore-platform-reqs
- name: Perform syntax check
run: ant lint
- name: Find coding standard violations using PHP Code Sniffer
run: ant phpcs
- name: Run unit tests with PHPUnit
if: ${{ matrix.php-version < '8.1' }}
run: ant phpunit
# We need to ignore the config file so that PHPUnit doesn't try to read it.
# The config file causes an error on PHP 8.1+ with PHPunit 7, but it's not needed here anyway
# as we can pass all required settings in the phpunit command.
- name: Run unit tests with PHPUnit (on PHP > 8.1)
if: ${{ matrix.php >= '8.1' }}
run: vendor/bin/phpunit vendor/squizlabs/php_codesniffer/tests/Standards/AllSniffs.php --no-configuration --bootstrap=bootstrap.php --dont-report-useless-tests