1
+ name : Unit tests
2
+
3
+ on : [push]
4
+
5
+ jobs :
6
+ build :
7
+ strategy :
8
+ matrix :
9
+ php : ['7.2', '7.3', '7.4']
10
+ phpunit : ['6.0', '7.0', '8.0']
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - uses : actions/checkout@v1
15
+
16
+ - name : Setup PHP
17
+ uses : shivammathur/setup-php@v1
18
+ with :
19
+ php-version : ${{ matrix.php }}
20
+ extensions : mbstring, intl, json, mongodb
21
+ coverage : pcov
22
+
23
+ - name : Validate composer.json and composer.lock
24
+ run : composer validate
25
+
26
+ - name : Declare required PHPUnit version
27
+ run : |
28
+ composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }}
29
+
30
+ - name : Install dependencies
31
+ run : composer install --prefer-dist --no-progress --no-suggest
32
+
33
+ # - name: Run type checker
34
+ # run: ./vendor/bin/psalm
35
+
36
+ - name : Run unit tests
37
+ run : ./vendor/bin/phpunit --testdox
38
+
39
+ coverage :
40
+ runs-on : ubuntu-latest
41
+
42
+ steps :
43
+ - uses : actions/checkout@v1
44
+
45
+ - name : Setup PHP
46
+ uses : shivammathur/setup-php@v1
47
+ with :
48
+ php-version : 7.4
49
+ extensions : mbstring, intl, json, mongodb
50
+ coverage : pcov
51
+
52
+ - name : Install dependencies
53
+ run : composer install --prefer-dist --no-progress --no-suggest
54
+
55
+ - name : Test & publish code coverage
56
+ uses : paambaati/codeclimate-action@v2.3.0
57
+ env :
58
+ CC_TEST_REPORTER_ID : ${{ secrets.codeClimateReporterID }}
59
+ with :
60
+ coverageCommand : ./vendor/bin/phpunit --coverage-clover=clover.xml
61
+ debug : true
0 commit comments