IBX-7021: Revert unit tests (WIP) #200
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- '[0-9]+.[0-9]+' | |
pull_request: ~ | |
jobs: | |
tests: | |
name: Unit tests & SQLite integration tests | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
experimental: [ false ] | |
php: | |
- '7.1' | |
- '7.2' | |
- '7.3' | |
- '7.4' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
extensions: pdo_sqlite, gd | |
tools: cs2pr | |
- uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
# - name: Run PHPStan analysis | |
# run: composer run-script phpstan | |
- name: Run code style check | |
run: composer run-script check-cs -- --format=checkstyle | cs2pr | |
- name: Run unit test suite | |
run: composer run-script unit | |
- name: Run integration test suite | |
run: composer run-script integration | |
integration-tests-postgres: | |
name: PostgreSQL integration tests | |
needs: tests | |
services: | |
postgres: | |
image: postgres:${{ matrix.postgres }} | |
ports: | |
- 5432 | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: testdb | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
--tmpfs /var/lib/postgres | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 60 | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
experimental: [ false ] | |
postgres: | |
- 10 | |
- 11 | |
- 14 | |
- 15 | |
php: | |
- '7.1' | |
- '7.4' | |
composer_options: [ "" ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
extensions: pdo_pgsql, gd | |
tools: cs2pr | |
- uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Run integration test suite vs Postgresql | |
run: composer run-script integration | |
env: | |
DATABASE_URL: "pgsql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/testdb?server_version=10" | |
# Required by old repository tests | |
DATABASE: "pgsql://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/testdb" | |
integration-tests-mysql: | |
name: MySQL integration tests | |
needs: tests | |
services: | |
mysql: | |
image: mysql:${{ matrix.mysql }} | |
ports: | |
- 3306/tcp | |
env: | |
MYSQL_RANDOM_ROOT_PASSWORD: true | |
MYSQL_USER: mysql | |
MYSQL_PASSWORD: mysql | |
MYSQL_DATABASE: testdb | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
--tmpfs=/var/lib/mysql | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '7.1' | |
- '7.4' | |
mysql: | |
- '5.7' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
extensions: pdo_mysql, gd, redis | |
tools: cs2pr | |
- uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Run integration test suite vs MySQL | |
run: composer run-script integration | |
env: | |
DATABASE_URL: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb" | |
DATABASE: "mysql://mysql:[email protected]:${{ job.services.mysql.ports[3306] }}/testdb" | |
integration-tests-mariadb: | |
name: MariaDB integration tests | |
needs: tests | |
services: | |
mariadb: | |
image: mariadb:${{ matrix.mariadb }} | |
ports: | |
- 3306/tcp | |
env: | |
MARIADB_RANDOM_ROOT_PASSWORD: true | |
MARIADB_USER: mariadb | |
MARIADB_PASSWORD: mariadb | |
MARIADB_DATABASE: testdb | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
--tmpfs=/var/lib/mariadb | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- '7.1' | |
- '7.4' | |
mariadb: | |
- '10.3' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: none | |
extensions: pdo_mysql, gd, redis | |
tools: cs2pr | |
- uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Run integration test suite vs MariaDB | |
run: composer run-script integration | |
env: | |
DATABASE_URL: "mysql://mariadb:[email protected]:${{ job.services.mariadb.ports[3306] }}/testdb" | |
DATABASE: "mysql://mariadb:[email protected]:${{ job.services.mariadb.ports[3306] }}/testdb" | |
functional-rest: | |
name: REST tests | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 10 | |
env: | |
COMPOSE_FILE: "doc/docker/base-dev.yml:doc/docker/selenium.yml" | |
SYMFONY_ENV: "behat" | |
PHP_IMAGE: "ezsystems/php:7.2-v1" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.1 | |
coverage: none | |
extensions: pdo_sqlite, gd | |
tools: cs2pr | |
- name: Setup the project | |
run: ./bin/.travis/prepare_behat.sh | |
- name: Run setup Command | |
run: | | |
cd "$HOME/build/ezplatform" | |
docker-compose --env-file=.env exec -T --user www-data app sh -c "bin/console ez:behat:create-language 'pol-PL' 'Polish (polski)'" | |
- name: Run tests | |
run: | | |
cd "$HOME/build/ezplatform" | |
docker-compose --env-file=.env exec -T --user www-data app sh -c "bin/phpunit -v vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishRestBundle/Tests/Functional" | |
intergation-solr: | |
name: Integration tests with Solr and Redis | |
runs-on: "ubuntu-22.04" | |
timeout-minutes: 20 | |
env: | |
CORES_SETUP: "shared" | |
SOLR_VERSION: "6.4.2" | |
COMPOSER_ROOT_VERSION: "7.5.x-dev" | |
CUSTOM_CACHE_POOL: "singleredis" | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: | |
--memory=60m | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.3 | |
coverage: none | |
extensions: pdo_pgsql, gd | |
tools: cs2pr | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '8' | |
- uses: ramsey/composer-install@v2 | |
with: | |
dependency-versions: highest | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Setup Solr | |
run: | | |
composer require ezsystems/ezplatform-solr-search-engine:^1.7.4@dev | |
./vendor/ezsystems/ezplatform-solr-search-engine/bin/.travis/init_solr.sh | |
- name: Run integration test suite vs Solr | |
run: vendor/bin/phpunit -c phpunit-integration-legacy-solr.xml |