66 - main
77 pull_request :
88 types : [opened, synchronize, reopened]
9+ env :
10+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11+
912jobs :
10- test :
11- name : Test with Symfony ${{ matrix.symfony-version }}
12- runs-on : ubuntu-latest
13+ lint_test :
14+ name : Lint & Test
15+ runs-on : nixos
1316 strategy :
1417 matrix :
15- symfony-version : ["^4", "^5", "^6"]
16- steps :
17- - uses : actions/checkout@v3
18- with :
19- fetch-depth : 0
20-
21- - name : Setup PHP with Xdebug
22- uses : shivammathur/setup-php@v2
23- with :
24- php-version : " 8.1"
25- coverage : xdebug
26-
27- - name : Get composer cache directory
28- id : composer-cache
29- run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
30-
31- - name : Cache dependencies
32- uses : actions/cache@v3
33- with :
34- path : ${{ steps.composer-cache.outputs.dir }}
35- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
36- restore-keys : ${{ runner.os }}-composer-
37-
38- - name : Install dependencies
39- run : >-
40- composer update --no-ansi --no-interaction --no-progress &&
41- composer require symfony/http-foundation:${{ matrix.symfony-version }}
42-
43- - name : Run tests
44- run : composer run-script test-ci
45-
46- - name : Fix code coverage paths
47- if : matrix.symfony-version == '^6'
48- run : sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
49-
50- - name : SonarCloud Scan
51- if : matrix.symfony-version == '^6'
52- uses : SonarSource/sonarcloud-github-action@master
53- env :
54- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
56-
57- lint :
58- name : Lint with PHPStan
59- runs-on : ubuntu-latest
18+ reqs :
19+ - symfony : " ^5"
20+ shell : " php81"
21+ - symfony : " ^5"
22+ shell : " php82"
23+ - symfony : " ^5"
24+ shell : " php83"
25+ - symfony : " ^6"
26+ shell : " php81"
27+ - symfony : " ^6"
28+ shell : " php82"
29+ - symfony : " ^6"
30+ shell : " php83"
31+ - symfony : " ^7"
32+ shell : " php82"
33+ - symfony : " ^7"
34+ shell : " php83"
35+ - symfony : " ^6"
36+ shell : " php84"
37+ - symfony : " ^7"
38+ shell : " php84"
39+ defaults :
40+ run :
41+ shell : nix develop .#${{ matrix.reqs.shell }} --command bash {0}
6042 steps :
6143 - uses : actions/checkout@v3
6244
@@ -67,14 +49,15 @@ jobs:
6749 key : ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
6850
6951 - name : Install dependencies
70- uses : php-actions/composer@v6
71- with :
72- php_version : " 8.1 "
52+ run : >-
53+ composer update --no-ansi --no-interaction --no-progress &&
54+ composer require symfony/http-foundation:${{ matrix.reqs.symfony }}
7355
74- - name : Lint
75- uses : php-actions/composer@v6
76- with :
77- php_version : " 8.1"
78- command : run-script
79- args : analyze
56+ - name : PHPCS
57+ run : ./vendor/bin/phpcs -s src tests
58+
59+ - name : PHPStan
60+ run : ./vendor/bin/phpstan analyse --level 8 src tests
8061
62+ - name : PHPUnit
63+ run : ./vendor/bin/phpunit tests
0 commit comments