Files
roundcubemail/.github/workflows/ci.yml
Pablo Zmdl a03221041e Run test with PHP 8.5-rc (#9970)
* Allow to inject composer arguments into testing scripts

* Run unit tests with PHP v8.5, too

* Run browser tests with PHP 8.5, too

* Depend on php-cs-fixer v3.8, which supports PHP v8.4

* Run code style checks in CI on PHP v8.4

* Check for vars being set and not null before using them as array keys

* Use generic tag name in container image build script

The script is meant for locally building images (the CI workflow runs
other code), so we now use localhost/ as namespace.

* Check that variable is usable before using it as array key

This includes proper type declarations for the method arguments and its return value.

* Ensure that the input to chr() is between 0 and 255.

* Require guzzle v7.10.0, which supports PHP 8.5

* Update phpunit a little to decide when to fail on deprecations

PHPUnit 10.5.47 and later know the flag `--do-not-fail-on-deprecation`, which allows us to make it not exit with code 1
in case of deprecations on the second run of the script. That second run uses the lowest valid dependencies, which might
contain deprecations when used with newer versions of PHP, but still are acceptable versions, and should not make our
tests fail.

* Run message rendering tests with PHP v8.4 and v8.5, too

* Check explicitly for null-ness

0 would be a valid value here.

* Replace chr() by mb_chr() and remove the workaround
2025-09-14 11:33:38 +02:00

80 lines
2.4 KiB
YAML

name: CI
on:
push:
pull_request:
permissions:
contents: read
jobs:
cs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
name: Coding Style
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
with:
php-version: "8.4"
extensions: mbstring
tools: composer:v2
coverage: none
- name: Install dependencies
run: |
composer install --prefer-dist --no-interaction --no-progress
npm install --omit=optional
- name: Check Coding Style - PHP
run: vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --diff --verbose
- name: Check composer.json format
run: composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock
- name: Check Coding Style - JS
run: npx eslint --ext .js .
- name: Plugins - Check composer.json format
run: |
for plugin_dir in plugins/*/; do (
echo "========== $plugin_dir =========="
cd "$plugin_dir"
composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock "$plugin_dir/composer.json"
echo " "
); done
phpstan:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
name: Static Analysis
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
with:
php-version: "8.4"
extensions: mbstring
tools: composer:v2
coverage: none
- name: Setup composer
run: |
composer require "kolab/net_ldap3:~1.1.1" --no-update
composer require "laravel/dusk:^8.3" --no-update
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Run Static Analysis
run: vendor/bin/phpstan analyse -v