Skip to content

Commit

Permalink
Update CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Aug 8, 2024
1 parent f53addd commit ea578df
Show file tree
Hide file tree
Showing 15 changed files with 613 additions and 143 deletions.
56 changes: 4 additions & 52 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,106 +9,64 @@ on:

jobs:
test:
name: "PHP ${{ matrix.php-version }} (elasticsearch ${{ matrix.elasticsearch-version }}, ${{ matrix.phpcr-transport }}, ${{ matrix.dependency-versions }})"
name: 'PHP ${{ matrix.php-version }} (${{ matrix.dependency-versions }}, Coverage ${{ matrix.coverage }})'
runs-on: ubuntu-latest

env:
DATABASE_URL: mysql://root:root@127.0.0.1:3306/sulu_test?serverVersion=5.7
PHPCR_TRANSPORT: ${{ matrix.phpcr-transport }}
APP_ENV: test
DATABASE_URL: mysql://root:root@127.0.0.1:3306/su_content_test?serverVersion=8.0.29&charset=utf8mb4&collation=utf8mb4_unicode_ci
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

strategy:
fail-fast: false
matrix:
include:
- php-version: '8.0'
elasticsearch-version: '7.11.1'
elasticsearch-package-constraint: '~7.11.0'
phpcr-transport: jackrabbit
dependency-versions: 'lowest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.1'
elasticsearch-version: '7.11.1'
elasticsearch-package-constraint: '~7.11.0'
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.2'
elasticsearch-version: '7.11.1'
elasticsearch-package-constraint: '~7.11.0'
phpcr-transport: jackrabbit
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.3'
elasticsearch-version: '7.17.2'
elasticsearch-package-constraint: '~7.17.0'
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
phpstan: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

- php-version: '8.4'
composer-options: '--ignore-platform-reqs'
elasticsearch-version: '8.14.3'
elasticsearch-package-constraint: '~7.17.0'
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
phpstan: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
ELASTICSEARCH_HOST: '127.0.0.1:9200'

services:
mysql:
image: mysql:5.7
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

jackrabbit:
image: sulu/jackrabbit:2.20-tomcat-filesystem
env:
DATABASE_HOST: mysql
DATABASE_PORT: 3306
DATABASE_NAME: sulu_test_jackrabbit
DATABASE_USER: root
DATABASE_PASS: root
LOG_LEVEL: WARN
ports:
- 8080:8080

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }}
ports:
- 9200:9200
env:
discovery.type: 'single-node'
xpack.security.enabled: 'false'
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5

steps:
- name: Checkout project
uses: actions/checkout@v4
Expand All @@ -126,9 +84,6 @@ jobs:
# testing lowest versions.
run: composer remove "*php-cs-fixer*" "*phpstan*" "*rector*" --dev --no-update

- name: Require elasticsearch dependency
run: composer require --dev elasticsearch/elasticsearch:"${{ matrix.elasticsearch-package-constraint }}" --no-interaction --no-update

- name: Install composer dependencies
uses: ramsey/composer-install@v2
with:
Expand Down Expand Up @@ -162,9 +117,6 @@ jobs:
tools: 'composer:v2'
coverage: none

- name: Require elasticsearch dependency
run: composer require --dev elasticsearch/elasticsearch:"~7.11.0" --no-interaction --no-update

- name: Install composer dependencies
uses: ramsey/composer-install@v2
with:
Expand Down
32 changes: 0 additions & 32 deletions SuluArticleBundle.php

This file was deleted.

2 changes: 1 addition & 1 deletion Tests/Application/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
APP_ENV=test
DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu_test?serverVersion=5.7&charset=utf8mb4&collation=utf8mb4_unicode_ci
DATABASE_URL=mysql://root:ChangeMe@127.0.0.1:3306/sulu_test?serverVersion=5.7&charset=utf8mb4&collation=utf8mb4_unicode_ci
14 changes: 7 additions & 7 deletions Tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
* with this source code in the file LICENSE.
*/

namespace Sulu\Bundle\ArticleBundle\Tests\Application;
namespace Sulu\Article\Tests\Application;

use ONGR\ElasticsearchBundle\ONGRElasticsearchBundle;
use Sulu\Bundle\ArticleBundle\SuluArticleBundle;
use Sulu\Bundle\ArticleBundle\Tests\TestExtendBundle\TestExtendBundle;
use Sulu\Article\Infrastructure\Symfony\HttpKernel\SuluArticleBundle;
use Sulu\Bundle\ContentBundle\SuluContentBundle;
use Sulu\Bundle\HeadlessBundle\SuluHeadlessBundle;
use Sulu\Bundle\TestBundle\Kernel\SuluTestKernel;
use Sulu\Component\HttpKernel\SuluKernel;
use Sulu\Messenger\Infrastructure\Symfony\HttpKernel\SuluMessengerBundle;
Expand All @@ -26,7 +23,7 @@
/**
* AppKernel for functional tests.
*/
class Kernel extends SuluTestKernel implements CompilerPassInterface
class Kernel extends SuluTestKernel
{
/**
* @var string|null
Expand Down Expand Up @@ -57,7 +54,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
parent::registerContainerConfiguration($loader);

$loader->load(__DIR__ . '/config/config.yml');
$loader->load(__DIR__ . '/config/config_' . $this->config . '.yml');

if (\file_exists(__DIR__ . '/config/config_' . $this->config . '.yml')) {
$loader->load(__DIR__ . '/config/config_' . $this->config . '.yml');
}
}

/**
Expand Down
Loading

0 comments on commit ea578df

Please sign in to comment.