@@ -32,16 +32,42 @@ jobs:
3232 matrix :
3333 php-version : ['8.2']
3434 steps :
35- - uses : actions/checkout@v3
35+ - uses : actions/checkout@v4
3636 - uses : shivammathur/setup-php@v2
3737 with :
3838 php-version : ' ${{ matrix.php-version }}'
3939 coverage : none
40- - run : make composer-install phpunit-install psalm-install
41- - run : php src/SonsOfPHP/Bard/bin/bard install -n -vvv
42- - run : make psalm-github
40+ - name : Cache Composer Packages
41+ id : composer-cache
42+ uses : actions/cache@v4
43+ with :
44+ path : vendor
45+ key : ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
46+ restore-keys : |
47+ ${{ runner.os }}-php-${{ matrix.php-version }}-
48+ - run : make composer.lock pkg-install tools/psalm/vendor/bin/psalm tools/phpunit/vendor/bin/phpunit
49+ - name : Get changed PHP files
50+ if : github.ref != 'refs/heads/main'
51+ id : changed-php-files
52+ uses : tj-actions/changed-files@v45
53+ with :
54+ files : |
55+ **.php
56+ - name : Psalm on modified PHP files only
57+ if : steps.changed-php-files.outputs.any_changed == 'true' && github.ref != 'refs/heads/main'
58+ run : php -dxdebug.mode=off ${PSALM} --ignore-baseline --long-progress --monochrome --output-format=github ${CHANGED_FILES}
59+ env :
60+ XDEBUG_MODE : off
61+ PSALM : tools/psalm/vendor/bin/psalm
62+ CHANGED_FILES : ${{ steps.changed-markdown-files.outputs.all_changed_files }}
63+ - name : Psalm on mainline for all files
64+ if : github.ref == 'refs/heads/main'
65+ run : php -dxdebug.mode=off $(PSALM) --ignore-baseline --long-progress --monochrome --output-format=github --report=results.sarif
66+ env :
67+ XDEBUG_MODE : off
68+ PSALM : tools/psalm/vendor/bin/psalm
4369 - name : Upload Security Analysis to Github
4470 if : github.ref == 'refs/heads/main'
45- uses : github/codeql-action/upload-sarif@v2
71+ uses : github/codeql-action/upload-sarif@v3
4672 with :
4773 sarif_file : results.sarif
0 commit comments