Skip to content

deps(deps): bump vimeo/psalm from 6.17.2 to 6.18.1 in /tools/psalm #2866

deps(deps): bump vimeo/psalm from 6.17.2 to 6.18.1 in /tools/psalm

deps(deps): bump vimeo/psalm from 6.17.2 to 6.18.1 in /tools/psalm #2866

Workflow file for this run

name: Test
on:
push:
pull_request:
release:
types:
- published
permissions:
contents: read
jobs:
build:
runs-on: "ubuntu-22.04"
strategy:
fail-fast: false
matrix:
php-versions: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6' ]
dependencies: [ 'highest' ]
include:
# The lowest allowed dependency set needs to be verified only once, and the
# oldest supported PHP is where consumers are most likely to end up with it.
- php-versions: '8.0'
dependencies: 'lowest'
# phpspec/prophecy enumerates the PHP versions it supports one by
# one (php 8.2.* || 8.3.* || 8.4.* || 8.5.*) instead of using a
# caret range, so it excludes 8.6 until it tags a release that adds
# it, and composer cannot resolve at all without relaxing the upper
# platform bound. It is the only dependency that needs this.
- php-versions: '8.6'
composer-flags: '--ignore-platform-req=php+'
name: "PHP ${{ matrix.php-versions }} (${{ matrix.dependencies }} deps)"
steps:
- uses: actions/checkout@v7
- name: Install PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
tools: composer:v2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v6
with:
path: |
vendor
tools/psalm/vendor
# composer.lock is not committed, so it cannot take part in the cache key:
# the installed set depends on the PHP version and on the resolution
# strategy, and both must be part of the key to keep the caches separate
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}-${{ matrix.dependencies }}-
- name: Install dependencies
if: ${{ matrix.dependencies == 'highest' }}
run: composer install --prefer-dist ${{ matrix.composer-flags }}
# Without a committed composer.lock every other job resolves to the newest
# allowed release, so the lower bounds declared in composer.json are never
# exercised. This job installs the other end of those ranges: the set a
# consumer with older pinned dependencies actually gets.
- name: Install lowest allowed dependencies
if: ${{ matrix.dependencies == 'lowest' }}
run: composer update --prefer-dist --prefer-lowest --prefer-stable
# Psalm 6 needs PHP >= 8.1 to run; the analysis target stays 8.0 (phpVersion in psalm.xml)
- name: Static Analysis
if: ${{ matrix.php-versions == '8.1' }}
run: |
composer install --prefer-dist -d tools/psalm
tools/psalm/vendor/bin/psalm --no-cache
# Both dependency sets report coverage: code that supports one version of a
# dependency is dead code under the other one, so a single set can never cover
# all of src. Codecov merges the two reports, and codecov.yml waits for both.
- name: Test with coverage
if: ${{ matrix.php-versions == '8.0' }}
run: ./bin/phpunit -d memory_limit=-1 --coverage-clover clover.xml
- name: Test without coverage
if: ${{ matrix.php-versions != '8.0' }}
run: ./bin/phpunit -d memory_limit=-1
- name: Upload coverage to Codecov
if: ${{ matrix.php-versions == '8.0' }}
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.dependencies }}
phar:
runs-on: "ubuntu-22.04"
needs: build
steps:
- uses: actions/checkout@v7
- name: Install PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: 8.2
tools: composer:v2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Box 4.x requires PHP 8.2+ to run, but the released PHAR must still
# support PHP 8.0+. Pin the resolver platform so composer installs the
# PHP 8.0-compatible dependency set regardless of the runner's PHP.
- name: "Pin composer platform to PHP 8.0 for the released PHAR"
run: composer config platform.php 8.0
- name: Install dependencies
run: composer install --prefer-dist --no-dev -o
- name: "Install box"
run: composer install --prefer-dist -d tools/box
- name: "Compile phparkitect phar"
run: tools/box/vendor/bin/box compile -c ./box.json
- name: "Check phar"
run: php ./phparkitect.phar
- name: "Rename phar to avoid conflicts"
run: mv ./phparkitect.phar phparkitect-${{ github.sha }}.phar
- name: "Upload phar file artifact"
uses: actions/upload-artifact@v7
with:
name: phar-artifact
path: ./phparkitect-${{ github.sha }}.phar
retention-days: 1
smoke-test-phar:
needs: phar
runs-on: "ubuntu-22.04"
strategy:
fail-fast: false
matrix:
php-versions: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5', '8.6' ]
steps:
- uses: actions/checkout@v7
- name: Install PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php-versions }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Download phar ./phparkitect-${{ github.sha }}.phar"
uses: actions/download-artifact@v8
with:
# will download phar in project root
name: phar-artifact
- name: "Smoke test phar"
run: php ./phparkitect-${{ github.sha }}.phar
- name: "End-to-end test phar: run check on fixture"
run: |
php ./phparkitect-${{ github.sha }}.phar check \
--config tests/E2E/_fixtures/autoload/phparkitect.php \
--autoload tests/E2E/_fixtures/autoload/autoload.php
- name: "End-to-end test phar: generate, use and prune a baseline"
run: |
php ./phparkitect-${{ github.sha }}.phar generate-baseline smoke-baseline.json \
--config tests/E2E/_fixtures/configMvcForYieldBug.php \
--autoload tests/E2E/_fixtures/autoload/autoload.php
test -s smoke-baseline.json
php ./phparkitect-${{ github.sha }}.phar check \
--config tests/E2E/_fixtures/configMvcForYieldBug.php \
--autoload tests/E2E/_fixtures/autoload/autoload.php \
--use-baseline smoke-baseline.json
php ./phparkitect-${{ github.sha }}.phar prune-baseline smoke-baseline.json \
--config tests/E2E/_fixtures/configMvcForYieldBug.php \
--autoload tests/E2E/_fixtures/autoload/autoload.php
test -s smoke-baseline.json
publish_phar:
needs: [build, smoke-test-phar]
runs-on: "ubuntu-22.04"
if: github.event_name == 'release'
permissions:
contents: write
steps:
- name: "Download phar ./phparkitect-${{ github.sha }}.phar"
uses: actions/download-artifact@v8
with:
# will download phar in project root
name: phar-artifact
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
with:
gpg_private_key: ${{ secrets.GPG_KEY_47CD54B6398FE21B3709D0A4D9C905CED1932CA2 }}
passphrase: ${{ secrets.GPG_KEY_47CD54B6398FE21B3709D0A4D9C905CED1932CA2_PASSPHRASE }}
- name: Rename phar
run: mv ./phparkitect-${{ github.sha }}.phar phparkitect.phar
- name: Sign the PHAR
run: |
gpg --local-user 47CD54B6398FE21B3709D0A4D9C905CED1932CA2 \
--batch \
--yes \
--passphrase="${{ secrets.GPG_KEY_47CD54B6398FE21B3709D0A4D9C905CED1932CA2_PASSPHRASE }}" \
--detach-sign \
--output ./phparkitect.phar.asc \
./phparkitect.phar
- name: Add phar to the release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
phparkitect.phar
phparkitect.phar.asc