Skip to content

Commit

Permalink
Fix the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sstok committed Apr 12, 2020
1 parent 8a689eb commit b46eb68
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 156 deletions.
38 changes: 0 additions & 38 deletions .github/phpunit/mysql.xml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/phpunit/pgsql.xml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/phpunit/sqlite.xml

This file was deleted.

52 changes: 10 additions & 42 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ name: Full CI process
on:
push:
branches:
- github-work-flow
- master
pull_request:
branches:
- master
env:
ES_HTTP_PORT: '59200'
ELASTICSEARCH_HOST: 'localhost'
ELASTICSEARCH_PORT: '59200'
QA_DOCKER_IMAGE: "rollerworks/search-phpqa:latest"

jobs:
test:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-18.04
strategy:
fail-fast: false
fail-fast: true
matrix:
php-versions: ['7.2', '7.3', '7.4']

Expand All @@ -29,7 +30,7 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: search_tests
ports:
- "5432:5432"
- "55432:5432"
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3

# https://docs.docker.com/samples/library/mysql/
Expand All @@ -39,7 +40,7 @@ jobs:
MYSQL_DATABASE: search_tests
MYSQL_ROOT_PASSWORD: nope
ports:
- "3306:3306"
- "53306:3306"
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

# https://hub.docker.com/_/elasticsearch/
Expand Down Expand Up @@ -77,50 +78,17 @@ jobs:
# —— Composer 🧙‍️ —————————————————————————————————————————————————————————
-
name: Install Composer dependencies
run: |
rm -f composer.lock
composer global require symfony/flex
composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --ansi
run: make in-docker-install

## —— Tests ✅ ———————————————————————————————————————————————————————————
-
name: Run Tests
env:
SYMFONY_DEPRECATIONS_HELPER: weak
run: |
vendor/bin/phpunit --verbose
vendor/bin/phpunit --verbose --configuration .github/phpunit/sqlite.xml
vendor/bin/phpunit --verbose --configuration .github/phpunit/pgsql.xml
vendor/bin/phpunit --verbose --configuration .github/phpunit/mysql.xml
lint:
name: PHP-QA
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
run: make in-docker-test
-
name: Checkout
uses: actions/checkout@v2
name: Setup PHP-QA
uses: docker://rollerworks/search-phpqa:latest

# https://github.com/shivammathur/setup-php (community)
-
name: Setup PHP, extensions and composer with shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, xml, ctype, iconv, intl, bcmath, pdo_sqlite, dom, filter, json, pgsql, pdo, pdo_pgsql, pdo_mysql
coverage: xdebug

# —— Composer 🧙‍️ —————————————————————————————————————————————————————————
-
name: Install Composer dependencies
run: |
rm -f composer.lock
composer global require symfony/flex
composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --ansi
-
name: Run PHP-QA
run: |
make lint || exit 0
docker run -it --rm -v "$(shell pwd):/project" -w /project ${QA_DOCKER_IMAGE}
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
QA_DOCKER_IMAGE=jakzal/phpqa:alpine
QA_DOCKER_COMMAND=docker run -t --rm -v "$(shell pwd):/project" -w /project ${QA_DOCKER_IMAGE}
QA_DOCKER_IMAGE=rollerworks/search-phpqa:latest
QA_DOCKER_COMMAND=docker run -it --rm -v "$(shell pwd):/project" -w /project ${QA_DOCKER_IMAGE}

dist: install cs-full phpstan test
ci: cs-full-check phpstan test
Expand Down Expand Up @@ -68,15 +68,15 @@ in-docker-install-lowest:

in-docker-test:
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/phpunit --verbose
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/phpunit --verbose --configuration phpunit/sqlite.xml
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/phpunit --verbose --configuration phpunit/pgsql.xml
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/phpunit --verbose --configuration phpunit/mysql.xml
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/phpunit --verbose --configuration travis/sqlite.travis.xml
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/phpunit --verbose --configuration travis/pgsql.travis.xml
SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/phpunit --verbose --configuration travis/mysql.travis.xml

in-docker-test-coverage:
SYMFONY_DEPRECATIONS_HELPER=weak phpdbg -qrr vendor/bin/phpunit --verbose --coverage-php build/cov/coverage-phpunit.cov
SYMFONY_DEPRECATIONS_HELPER=weak phpdbg -qrr vendor/bin/phpunit --verbose --configuration phpunit/sqlite.xml --coverage-php build/cov/coverage-phpunit-sqlite.cov
SYMFONY_DEPRECATIONS_HELPER=weak phpdbg -qrr vendor/bin/phpunit --verbose --configuration phpunit/pgsql.xml --coverage-php build/cov/coverage-phpunit-pgsql.cov
SYMFONY_DEPRECATIONS_HELPER=weak phpdbg -qrr vendor/bin/phpunit --verbose --configuration phpunit/mysql.xml --coverage-php build/cov/coverage-phpunit-mysql.cov
SYMFONY_DEPRECATIONS_HELPER=weak phpdbg -qrr vendor/bin/phpunit --verbose --configuration travis/sqlite.travis.xml --coverage-php build/cov/coverage-phpunit-sqlite.cov
SYMFONY_DEPRECATIONS_HELPER=weak phpdbg -qrr vendor/bin/phpunit --verbose --configuration travis/pgsql.travis.xml --coverage-php build/cov/coverage-phpunit-pgsql.cov
SYMFONY_DEPRECATIONS_HELPER=weak phpdbg -qrr vendor/bin/phpunit --verbose --configuration travis/mysql.travis.xml --coverage-php build/cov/coverage-phpunit-mysql.cov

docs:
docker build docs/ -t rollerworks-search-docs
Expand Down
4 changes: 1 addition & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
colors="true" verbose="true"
bootstrap="vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
Expand All @@ -13,8 +13,6 @@
<ini name="intl.default_locale" value="en"/>
<ini name="intl.error_level" value="0"/>
<ini name="memory_limit" value="-1"/>

<!--<env name="ELASTICSEARCH_PORT" value="59200" />-->
</php>

<testsuites>
Expand Down
2 changes: 1 addition & 1 deletion phpunit/mysql.xml → travis/mysql.travis.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd"
colors="true"
bootstrap="../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
Expand Down
2 changes: 1 addition & 1 deletion phpunit/pgsql.xml → travis/pgsql.travis.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd"
colors="true"
bootstrap="../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
Expand Down
2 changes: 1 addition & 1 deletion phpunit/sqlite.xml → travis/sqlite.travis.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd"
colors="true"
bootstrap="../vendor/autoload.php"
beStrictAboutOutputDuringTests="true"
Expand Down

1 comment on commit b46eb68

@sstok
Copy link
Member Author

@sstok sstok commented on b46eb68 Apr 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly have no idea how this happened. But there is special place in hell for this commit!

Please sign in to comment.