Files
roundcubemail/.github/workflows/browser_tests.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

89 lines
2.7 KiB
YAML

name: E2E
on:
push:
pull_request:
permissions:
contents: read
jobs:
browser_tests:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
php: ["8.1", "8.3", "8.5"]
name: Linux / PHP ${{ matrix.php }}
services:
mailhost:
image: docker.io/greenmail/standalone
ports:
- '3143:3143'
- '3025:3025'
browserhost:
image: docker.io/selenium/standalone-chromium
volumes:
- '/dev/shm:/dev/shm'
- ${{ github.workspace }}:/roundcubemail
ports:
- '4444:4444'
options: '--add-host=host.docker.internal:host-gateway'
env:
WEBDRIVER_CONNECT_URL: 'http://localhost:4444'
SERVER_URL: 'http://host.docker.internal:8000'
SERVER_BIND: '0.0.0.0:8000'
BROWSER_DOWNLOADS_DIR: '/roundcubemail/tests/Browser/downloads'
TESTRUNNER_DOWNLOADS_DIR: './tests/Browser/downloads'
RC_CONFIG_IMAP_HOST: 'tls://localhost:3143'
RC_CONFIG_SMTP_HOST: 'localhost:3025'
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: ${{ matrix.php }}
extensions: dom, curl, fileinfo, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, ldap, intl, pspell
tools: composer:v2
coverage: none
- name: Setup NPM
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: '16'
- name: Setup problem matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install Aspell
run: sudo apt-get -y install aspell aspell-en aspell-de
- name: Execute tests
if: ${{ matrix.php != '8.5' }}
run: .ci/run_browser_tests.sh
# Pass in a composer arg to make composer not complain about PHP version constrains with v8.5-rc until all
# dependency packages have released a version that supports v8.5.
- name: Execute tests
if: ${{ matrix.php == '8.5' }}
env:
COMPOSER_ARGS: "--ignore-platform-reqs"
run: .ci/run_browser_tests.sh
- name: Upload screenshots as artifacts
# Upload screenshot if the test suite failed.
if: failure()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
with:
name: screenshots
path: tests/Browser/screenshots