Skip to content

fix(deps): update dependency anthropic-ai/sdk to ^0.46.0 #5262

fix(deps): update dependency anthropic-ai/sdk to ^0.46.0

fix(deps): update dependency anthropic-ai/sdk to ^0.46.0 #5262

on:
pull_request:
branches:
main
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
push:
branches:
main
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'infection.json.dist'
- 'phpunit.xml.dist'
schedule:
- cron: '0 0 * * *'
name: invoice static analysis
jobs:
psalm:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
# PHP 8.6/9.0 workflow legs deliberately removed until 8.6 actually
# releases — premature to carry a pre-release matrix leg for it
# before then.
include:
- os: ubuntu-latest
php: '8.5'
experimental: false
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo, pdo, pdo_sqlite, intl, gd, openssl, dom, json, mbstring, curl, uopz
tools: composer:v2, cs2pr
coverage: none
- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Cache dependencies installed with composer
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Update composer
run: composer self-update
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Static analysis
run: vendor/bin/psalm --shepherd --stats --output-format=checkstyle | cs2pr --graceful-warnings --colorize
psalm-alpine:
name: PHP ${{ matrix.php }}-alpine${{ matrix.alpine }}
runs-on: ubuntu-latest
container:
image: alpine:${{ matrix.alpine }}
# PHP 8.5 hits an open, upstream Psalm bug unrelated to Alpine —
# https://github.com/vimeo/psalm/issues/11831 ("Psalm crash due to NAN
# on PHP 8.5"). The php85/alpine:edge leg below is disabled entirely
# for the time being rather than just tolerated via continue-on-error,
# since it's currently failing outright. Re-enable both the leg and
# the continue-on-error once that issue is fixed upstream.
continue-on-error: ${{ matrix.php == '85' }}
strategy:
fail-fast: false
matrix:
# See invoice_dependency.yml's mutation-alpine job for why PHP and
# Alpine versions are paired explicitly rather than a free matrix.
include:
- php: '84'
alpine: '3.22'
# - php: '85'
# alpine: 'edge'
steps:
- name: Install glibc compatibility layer
run: apk add --no-cache gcompat
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
# See invoice_dependency.yml's mutation-alpine job for why PHP/Composer
# are set up directly via apk rather than shivammathur/setup-php.
- name: Install PHP and extensions
run: |
apk add --no-cache \
php${{ matrix.php }} \
php${{ matrix.php }}-phar \
php${{ matrix.php }}-bcmath \
php${{ matrix.php }}-ctype \
php${{ matrix.php }}-curl \
php${{ matrix.php }}-dom \
php${{ matrix.php }}-fileinfo \
php${{ matrix.php }}-gd \
php${{ matrix.php }}-iconv \
php${{ matrix.php }}-intl \
php${{ matrix.php }}-mbstring \
php${{ matrix.php }}-openssl \
php${{ matrix.php }}-pdo \
php${{ matrix.php }}-pdo_sqlite \
php${{ matrix.php }}-pecl-apcu \
php${{ matrix.php }}-simplexml \
php${{ matrix.php }}-sodium \
php${{ matrix.php }}-tokenizer \
php${{ matrix.php }}-xml \
php${{ matrix.php }}-xmlreader \
php${{ matrix.php }}-xmlwriter
ln -sf /usr/bin/php${{ matrix.php }} /usr/bin/php
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
rm composer-setup.php
# ext-zend-opcache is a separate package on php84, but bundled
# directly into the php85 apk package (no php85-opcache package
# exists yet) — install it only where it exists as its own package.
- name: Install ext-opcache (PHP 8.4 only)
if: matrix.php == '84'
run: apk add --no-cache php84-opcache
# Alpine's stock php.ini defaults to memory_limit=128M; Psalm's static
# analysis of the full codebase exceeds that. setup-php sets this to
# unlimited by default on the Ubuntu leg, which is why this only shows
# up here.
- name: Raise PHP memory_limit
run: echo "memory_limit=-1" > /etc/php${{ matrix.php }}/conf.d/99-memory-limit.ini
- name: Set up Composer GitHub auth
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: composer config --global --auth github-oauth.github.com "$GITHUB_TOKEN"
- name: Determine composer cache directory
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Cache dependencies installed with composer
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-alpine${{ matrix.alpine }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-alpine${{ matrix.alpine }}-composer-
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
# cs2pr (checkstyle-to-PR-annotation) is installed via setup-php's
# `tools:` input on the Ubuntu job; no Alpine equivalent is wired up
# here, so this leg runs Psalm directly without the annotation step —
# the goal is proving Psalm itself is clean on Alpine/PHP84+85, not
# replicating the PR-annotation UX.
- name: Static analysis
run: vendor/bin/psalm --shepherd --stats