-
Notifications
You must be signed in to change notification settings - Fork 16
58 lines (48 loc) · 1.49 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
49
50
51
52
53
54
55
56
57
58
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
tests:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- php: '7.4'
tools: phpunit:9
- php: '8.0'
tools: cs2pr,phpcs,phpunit:9,psalm
analyze: true
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: ${{ matrix.tools }}
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
if: matrix.analyze
- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-
${{ runner.os }}-
- run: composer install --no-interaction
- name: Psalm
run: psalm --output-format=github
if: always() && matrix.analyze
- name: PHP CodeSniffer
run: phpcs --report=checkstyle | cs2pr
if: always() && matrix.analyze
- name: PHPUnit
run: phpunit --coverage-text
if: always()