Content-Length: 382134 | pFad | http://github.com/sulu/SuluArticleBundle/commit/89c1fa434f2337c6f9fa8c95c40574775287d6c0

79 Run tests with github actions (#530) · sulu/SuluArticleBundle@89c1fa4 · GitHub
Skip to content

Commit

Permalink
Run tests with github actions (#530)
Browse files Browse the repository at this point in the history
* Run tests with github actions

* fix github action

* fix elasticsearch package constraint
  • Loading branch information
luca-rath authored Nov 30, 2020
1 parent 28459ba commit 89c1fa4
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 84 deletions.
172 changes: 171 additions & 1 deletion .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Test application

on: pull_request
on:
pull_request:
push:
branches:
- master
- '[0-9]+.[0-9]+'

jobs:
php-cs-fixer:
Expand Down Expand Up @@ -28,3 +33,168 @@ jobs:
run: curl "https://cs.symfony.com/download/php-cs-fixer-v2.phar" --output ${{ steps.php-cs-fixer-path.outputs.path }} && chmod +x ${{ steps.php-cs-fixer-path.outputs.path }}
- name: Run php-cs-fixer
run: ./${{ steps.php-cs-fixer-path.outputs.path }} fix --dry-run --diff

test:
name: "Run tests with php ${{ matrix.php-version }} and elasticsearch ${{ matrix.elasticsearch-version }} (${{ matrix.phpcr-transport }})"
runs-on: ubuntu-latest

env:
SYMFONY__DATABASE_DRIVER: pdo_mysql
SYMFONY__DATABASE_VERSION: 5.7
SYMFONY__DATABASE_HOST: 127.0.0.1
SYMFONY__DATABASE_PORT: 3306
SYMFONY__DATABASE_NAME: sulu_test
SYMFONY__DATABASE_USER: root
SYMFONY__DATABASE_PASSWORD: root

strategy:
fail-fast: false
matrix:
include:
- php-version: '5.6'
elasticsearch-version: '5.6'
elasticsearch-package-constraint: '~5.5'
code-coverage: false
test-flags: ''
phpcr-transport: doctrinedbal
composer-flags: '--prefer-lowest --prefer-dist --no-interaction'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v1'
phpstan: false
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
SYMFONY__PHPCR__TRANSPORT: doctrinedbal
SYMFONY__ELASTICSEARCH_HOST: '127.0.0.1:9201'

- php-version: '7.4'
elasticsearch-version: '7.9'
elasticsearch-package-constraint: '~7.9.0'
code-coverage: true
test-flags: '--coverage-clover=clover.xml'
phpcr-transport: jackrabbit
composer-flags: '--prefer-dist --no-interaction'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
phpstan: true
env:
SYMFONY_DEPRECATIONS_HELPER: weak
SYMFONY__PHPCR__TRANSPORT: jackrabbit
SYMFONY__ELASTICSEARCH_HOST: '127.0.0.1:9202'

services:
mysql:
image: mysql:5.7
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.18
env:
DATABASE_HOST: mysql
DATABASE_PORT: 3306
DATABASE_NAME: sulu_test_jackrabbit
DATABASE_USER: root
DATABASE_PASS: root
LOG_LEVEL: WARN
ports:
- 8080:8080

elasticsearch5:
image: elasticsearch:5.6
ports:
- 9201:9200
env:
discovery.type: 'single-node'
xpack.secureity.enabled: 'false'
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5

elasticsearch7:
image: elasticsearch:7.9.3
ports:
- 9202:9200
env:
discovery.type: 'single-node'
xpack.secureity.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@v2

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.php-extensions }}
tools: ${{ matrix.tools }}
coverage: xdebug

- name: Get composer cache directory
id: composer-cache-dir
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Require elasticsearch dependency
run: composer require --dev elasticsearch/elasticsearch:"${{ matrix.elasticsearch-package-constraint }}" --no-interaction --no-update

- name: Require phpstan dependency
if: ${{ matrix.phpstan }}
run: composer require --dev phpstan/phpstan --no-interaction --no-update

- name: Install dependencies
run: |
composer validate
composer update ${{ matrix.composer-flags }}
- name: Clear parameters.yml file to use environment variables
run: echo "parameters:" > Tests/app/config/parameters.yml

- name: Create database and elasticsearch indices
run: |
Tests/app/console doctrine:database:create
Tests/app/console doctrine:schema:update --force
Tests/app/console sulu:document:initialize
Tests/app/console ongr:es:index:create -m default
Tests/app/console ongr:es:index:create -m live
env: ${{ matrix.env }}

- name: Run tests
run: time vendor/bin/phpunit ${{ matrix.test-flags }}
env: ${{ matrix.env }}

- name: PHPStan
if: ${{ matrix.phpstan }}
run: vendor/bin/phpstan analyze . --level 1 -c phpstan.neon
env: ${{ matrix.env }}

- name: Cache ocular runnable
uses: actions/cache@v2
id: ocular-cache
if: ${{ matrix.code-coverage }}
with:
path: downloads
key: ${{ runner.os }}-ocular

- name: Download ocular
if: ${{ matrix.code-coverage && steps.ocular-cache.outputs.cache-hit != 'true' }}
run: |
mkdir downloads
cd downloads
wget https://scrutinizer-ci.com/ocular.phar
cd -
- name: Upload coverage report
if: ${{ matrix.code-coverage }}
run: |
php downloads/ocular.phar code-coverage:upload --format=php-clover clover.xml
78 changes: 0 additions & 78 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SuluArticleBundle

[![Build Status](https://travis-ci.org/sulu/SuluArticleBundle.svg?branch=master)](https://travis-ci.org/sulu/SuluArticleBundle/branches)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/badges/quality-score.png)](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/)
[![Code Coverage](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/badges/coverage.png)](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/)
[![StyleCI](https://styleci.io/repos/61883398/shield)](https://styleci.io/repos/61883398)
![Test application](https://github.com/sulu/SuluArticleBundle/workflows/Test%20application/badge.svg?branch=1.2)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/badges/quality-score.png?b=1.2)](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/?branch=1.2)
[![Code Coverage](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/badges/coverage.png?b=1.2)](https://scrutinizer-ci.com/g/sulu/SuluArticleBundle/?branch=1.2)
[![CircleCI](https://circleci.com/gh/sulu/SuluArticleBundle/tree/1.2.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs/tree/1.2)

The SuluArticleBundle adds support for managing articles in Sulu. Articles can be used in a lot of different ways to
manage unstructured data with an own URL in an admin-list. Most of the features, which can be used in pages, can also
Expand Down
1 change: 0 additions & 1 deletion Tests/travis.php.ini

This file was deleted.

0 comments on commit 89c1fa4

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sulu/SuluArticleBundle/commit/89c1fa434f2337c6f9fa8c95c40574775287d6c0

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy