1- name : " Tests "
1+ name : " CI "
22
3- on : [push, pull_request ]
3+ on : [push]
44
55jobs :
6- run-tests :
7- name : PHP ${{ matrix.php-versions }}
6+ validate-and-test :
7+ name : Static Analysis & Tests with PHP ${{ matrix.php-versions }}
88 runs-on : ubuntu-latest
99 env :
1010 extensions : mbstring, intl, json, phalcon, redis, mongodb, xdebug
11- key : cache-v0.0.2
11+ key : cache-v0.0.3
1212 services :
1313 mongodb :
14- image : mongo:3.6
14+ image : mongo:4.0
1515 ports :
1616 - 27017:27017
1717 strategy :
1818 fail-fast : false
1919 matrix :
20- php-versions : ['7.4 ', '8.0 ', '8.1 ', '8.2 ']
20+ php-versions : ['8.1 ', '8.2 ', '8.3 ', '8.4 ']
2121 steps :
2222 - uses : actions/checkout@v5
2323
24+ - name : Validate composer.json and composer.lock
25+ run : composer validate
26+
2427 - name : Setup cache environment
2528 id : cache-env
2629 uses : shivammathur/cache-extensions@v1
@@ -44,27 +47,28 @@ jobs:
4447 extensions : ${{ env.extensions }}
4548 tools : pecl
4649
47- - name : Get Composer Cache Directory
48- id : composer-cache
49- run : echo "::set-output name=dir::$(composer config cache-files-dir)"
50-
51- - name : Cache composer dependencies
52- uses : actions/cache@v3
53- with :
54- path : ${{ steps.composer-cache.outputs.dir }}
55- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
56- restore-keys : ${{ runner.os }}-composer-
57-
5850 - name : Install Composer dependencies
5951 run : composer install --prefer-dist --no-suggest
6052
53+ - name : Validate Code Style
54+ if : always()
55+ run : vendor/bin/phpcs
56+
57+ - name : Run Psalm
58+ if : always()
59+ run : vendor/bin/psalm
60+
61+ - name : Run PHPStan
62+ if : always()
63+ run : vendor/bin/phpstan analyse src
64+
6165 - name : Run test suites
6266 if : success()
63- run : vendor/bin/codecept run --coverage-xml =coverage-${{ matrix.php-versions }}.xml
67+ run : vendor/bin/phpunit --coverage-clover =coverage-${{ matrix.php-versions }}.xml
6468
6569 - name : Upload coverage to Codecov
6670 if : success()
6771 uses : codecov/codecov-action@v3
6872 with :
6973 token : ${{secrets.CODECOV_TOKEN}}
70- file : ./tests/_output/ coverage-*.xml
74+ file : ./coverage-*.xml
0 commit comments