This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/.github/workflows/psalm.yml

56 lines
1.7 KiB
YAML
Raw Normal View History

2021-02-16 07:30:58 +00:00
name: Static analysis
on:
pull_request: ~
2021-02-25 19:32:02 +00:00
defaults:
run:
shell: bash
2021-02-16 07:30:58 +00:00
jobs:
psalm:
name: Psalm
runs-on: Ubuntu-20.04
steps:
2021-06-25 09:27:06 +01:00
- name: Setup PHP
2021-02-16 07:30:58 +00:00
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: "json,memcached,mongodb,redis,xsl,ldap,dom"
ini-values: "memory_limit=-1"
coverage: none
2021-02-25 19:32:02 +00:00
- name: Checkout target branch
2021-02-16 07:30:58 +00:00
uses: actions/checkout@v2
with:
2021-02-25 19:32:02 +00:00
ref: ${{ github.base_ref }}
2021-02-16 07:30:58 +00:00
2021-02-25 19:32:02 +00:00
- name: Checkout PR
2021-02-16 07:30:58 +00:00
uses: actions/checkout@v2
2021-06-25 09:27:06 +01:00
- name: Install dependencies
2021-02-16 07:30:58 +00:00
run: |
2021-02-25 19:32:02 +00:00
COMPOSER_HOME="$(composer config home)"
([ -d "$COMPOSER_HOME" ] || mkdir "$COMPOSER_HOME") && cp .github/composer-config.json "$COMPOSER_HOME/config.json"
2021-06-25 09:27:06 +01:00
export COMPOSER_ROOT_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+').x-dev
2021-06-29 10:23:13 +01:00
composer remove --dev --no-update --no-interaction symfony/phpunit-bridge
composer require --no-update psalm/phar phpunit/phpunit:^9.5 php-http/discovery psr/event-dispatcher mongodb/mongodb
2021-06-25 09:27:06 +01:00
2021-02-25 19:32:02 +00:00
echo "::group::composer update"
composer update --no-progress --ansi
git checkout composer.json
echo "::endgroup::"
2021-06-25 09:27:06 +01:00
2021-02-25 19:32:02 +00:00
./vendor/bin/psalm.phar --version
2021-02-16 07:30:58 +00:00
- name: Generate Psalm baseline
run: |
2021-02-25 19:32:02 +00:00
git checkout -m ${{ github.base_ref }}
./vendor/bin/psalm.phar --set-baseline=.github/psalm/psalm.baseline.xml --no-progress
git checkout -m FETCH_HEAD
2021-02-16 07:30:58 +00:00
- name: Psalm
run: |
2021-02-25 19:32:02 +00:00
./vendor/bin/psalm.phar --output-format=github --no-progress