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

59 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:
- name: Set up PHP
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
- name: Configure composer
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"
echo "COMPOSER_ROOT_VERSION=$(grep -m1 SYMFONY_VERSION .travis.yml | grep -o '[0-9.x]*').x-dev" >> $GITHUB_ENV
2021-02-16 07:30:58 +00:00
- name: Install Psalm
run: |
2021-02-25 19:32:02 +00:00
echo "::group::modify composer.json"
composer remove --no-update --no-interaction symfony/phpunit-bridge
composer require --no-update psalm/phar phpunit/phpunit:^9.5 php-http/discovery psr/event-dispatcher
2021-02-25 19:32:02 +00:00
echo "::endgroup::"
echo "::group::composer update"
composer update --no-progress --ansi
git checkout composer.json
echo "::endgroup::"
./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