diff --git a/.github/workflows/psalm-baseline.yml b/.github/workflows/psalm-baseline.yml new file mode 100644 index 0000000000000..7959d14e4f8b2 --- /dev/null +++ b/.github/workflows/psalm-baseline.yml @@ -0,0 +1,77 @@ +name: Update psalm baseline + +on: + schedule: + - cron: '0 6 1 * *' + +defaults: + run: + shell: bash + +jobs: + psalm: + name: Psalm baseline + runs-on: Ubuntu-20.04 + strategy: + fail-fast: false + matrix: + branch: ['4.4', '5.x'] + + 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 + + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ matrix.branch }} + + - name: Configure composer + run: | + 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 + + - name: Install dependencies + run: | + echo "::group::modify composer.json" + composer remove --no-interaction --no-update symfony/phpunit-bridge + composer require psalm/phar phpunit/phpunit php-http/discovery psr/event-dispatcher --no-update + echo "::endgroup::" + echo "::group::composer update" + composer update --no-progress --ansi + git checkout composer.json + echo "::endgroup::" + ./vendor/bin/psalm.phar --version + + - name: Generate Psalm baseline + run: /vendor/bin/psalm.phar --set-baseline=.github/psalm/psalm.baseline.xml --no-progress + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.CARSONBOT_GITHUB_TOKEN }} + push-to-fork: carsonbot/symfony + author: carsonbot + committer: carsonbot + commit-message: Update psalm baseline + title: Update psalm baseline - ${{ matrix.branch }} + body: | + | Q | A + | ------------- | --- + | Branch? | ${{ matrix.branch }} + | Bug fix? | no + | New feature? | no + | Deprecations? | no + | Tickets | + | License | MIT + | Doc PR | + + The psalm baseline has changed for branch ${{ matrix.branch }}. + branch: psalm-baseline-${{ matrix.branch }} + base: ${{ matrix.branch }}