Skip to content

Refactor phpunit dataprovider to be static #9657

Refactor phpunit dataprovider to be static

Refactor phpunit dataprovider to be static #9657

name: Test application
on:
pull_request:
push:
branches:
- '[0-9]+.x'
- '[0-9]+.[0-9]+'
# automatically cancel previously started workflows when pushing a new commit to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
js-css:
name: "Node ${{ matrix.node-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- node-version: '14'
styleguide: false
- node-version: '16'
npm-version: '6'
styleguide: true
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Install and configure Node
uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.node-version }}
- name: Install npm
if: ${{ matrix.npm-version }}
run: npm install --global npm@${{ matrix.npm-version }}
- name: Assert error when using yarn
run: tests/js/check-yarn-warning.sh
- name: Install npm dependencies
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Output versions and installed dependencies
run: |
node --version
npm --version
npm list || true # ignore peer dependency errors
- name: Test JavaScript code
run: npm test -- --maxWorkers=4
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: 'composer:v2'
ini-values: memory_limit=-1
coverage: none
- name: Install php dependencies
run: rm composer.json && composer require friendsofsymfony/jsrouting-bundle:^2.3 --no-interaction
- name: Test application build
run: npm run build
- name: Test Styleguidist build
if: ${{ matrix.styleguide }}
run: npm run styleguide:build
js-lint:
name: "Node Lint"
runs-on: ubuntu-latest
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Install and configure Node
uses: actions/setup-node@v2-beta
with:
node-version: '14'
- name: Assert error when using yarn
run: tests/js/check-yarn-warning.sh
- name: Install npm dependencies
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Lint JavaScript
run: npm run lint:js
- name: Lint SCSS
run: npm run lint:scss
- name: Flow
run: npm run flow -- check
- name: Depcruise
run: npm run depcruise
php:
name: "PHP ${{ matrix.php-version }} (${{ matrix.database }}, ${{ matrix.phpcr-transport }}, ${{ matrix.dependency-versions }})"
runs-on: ubuntu-latest
env:
APP_ENV: test
APP_SECRET: a448d1dfcaa563fce56c2fd9981f662b
MAILER_URL: null://localhost
SULU_ADMIN_EMAIL:
PHPCR_TRANSPORT: ${{ matrix.phpcr-transport }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- php-version: '8.0'
database: mysql-57
phpcr-transport: doctrinedbal
dependency-versions: 'lowest'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
DATABASE_URL: mysql://root@127.0.0.1:3306/sulu_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci
- php-version: '8.1'
database: mysql-57
phpcr-transport: jackrabbit
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root@127.0.0.1:3306/sulu_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci
- php-version: '8.2'
database: postgres-14
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: postgres://symfony:ChangeMe@127.0.0.1:5432/sulu_test?serverVersion=14.11
DATABASE_CHARSET: UTF8
DATABASE_COLLATE:
- php-version: '8.3'
database: mysql-80
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v2'
composer-stability: 'dev'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:ChangeMe@127.0.0.1:3306/sulu_test?serverVersion=8.0
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Start Database
run: |
docker compose -f tests/docker/docker-compose.${{ matrix.database }}.yml up --wait
- name: Start Jackrabbit
if: ${{ matrix.phpcr-transport == 'jackrabbit' }}
run: |
docker compose -f tests/docker/docker-compose.jackrabbit.yml up --wait
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.php-extensions }}
tools: ${{ matrix.tools }}
ini-values: memory_limit=-1
coverage: none
- name: Require jackrabbit dependencies
if: ${{ matrix.phpcr-transport == 'jackrabbit' }}
run: |
composer remove jackalope/jackalope-doctrine-dbal --dev --no-interaction --no-update
composer require jackalope/jackalope-jackrabbit:^1.4 --no-interaction --no-update
- name: Install additional lowest dependencies
if: ${{ matrix.dependency-versions == 'lowest' }}
run: |
composer require symfony/swiftmailer-bundle --no-interaction --no-update
- name: Set composer stability
if: ${{ matrix.composer-stability }}
run: composer config minimum-stability ${{ matrix.composer-stability }}
- name: Install composer dependencies
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{matrix.dependency-versions}}
- name: Output versions and installed dependencies
run: |
php --version
php -m
composer info
- name: Bootstrap test environment
run: composer bootstrap-test-environment
env: ${{ matrix.env }}
- name: Execute test cases
run: time composer test
env: ${{ matrix.env }}
php-lint:
name: "PHP Lint"
runs-on: ubuntu-latest
env:
APP_ENV: test
APP_SECRET: a448d1dfcaa563fce56c2fd9981f662b
MAILER_URL: null://localhost
SULU_ADMIN_EMAIL:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: 'ctype, iconv, mysql'
tools: 'composer:v2'
ini-values: memory_limit=-1
coverage: none
- name: Install composer dependencies
uses: ramsey/composer-install@v1
with:
dependency-versions: highest
- name: Lint code
run: composer lint