Skip to content

Commit

Permalink
IBX-829 [CI] Moved CS and PHPUnit jobs to Github Actions (#60)
Browse files Browse the repository at this point in the history
* IBX-829 [CI] Moved jobs to Github Actions

* IBX-829-small-correction

* IBX-829-adjusting-GHactions

* IBX-829-adjustment

* IBX-829 review fixes
  • Loading branch information
piotrbisaga authored Sep 24, 2021
1 parent ac033cc commit fad3c2a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 14 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

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

jobs:
tests:
name: Tests
runs-on: "ubuntu-20.04"
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
php:
- '7.1'
- '7.2'
- '7.3'
- '7.4'
composer_options: [ "" ]

steps:
- uses: actions/checkout@v2

- 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@v1"
with:
dependency-versions: "highest"
composer-options: "${{ matrix.composer_options }}"

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

- name: Run test suite
run: composer run-script --timeout=600 test
16 changes: 3 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ branches:

matrix:
include:
- name: "Code Style Check"
env: CHECK_CS=1
- name: "PHP 7.3 Integration tests"
php: 7.3
env: PHPUNIT_CONFIG="phpunit-integration-legacy.xml"
- name: "Browser fieldtype tests"
php: 7.3
env:
Expand All @@ -49,15 +44,10 @@ before_install:
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

install:
# Install packages if needed
- if [ "${CHECK_CS}" == "1" -o "${PHPUNIT_CONFIG}" != "" ]; then travis_retry composer install --prefer-dist --no-interaction --no-suggest ; fi
# Prepare whole environment if needed
- if [ "${BEHAT_OPTS}" != "" ]; then ./.travis/prepare_ezplatform.sh ${INSTALL_EZ_INSTALL_TYPE}; fi
- ./.travis/prepare_ezplatform.sh ${INSTALL_EZ_INSTALL_TYPE}

script:
- if [ "${CHECK_CS}" == "1" ] ; then ./vendor/bin/php-cs-fixer fix -v --dry-run --show-progress=estimating ; fi
- if [ "${PHPUNIT_CONFIG}" != '' ]; then ./vendor/bin/phpunit -c "${PHPUNIT_CONFIG}"; fi
- if [ "${BEHAT_OPTS}" != "" ]; then cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "bin/ezbehat ${BEHAT_OPTS}" ; fi
- cd "$HOME/build/ezplatform"; docker-compose exec --user www-data app sh -c "bin/ezbehat ${BEHAT_OPTS}"

after_failure:
# Will show us the last bit of the log of container's main processes
Expand All @@ -68,4 +58,4 @@ after_failure:
- docker ps -s

after_script:
- if [ "${BEHAT_OPTS}" != "" ] ; then bin/ezreport ; fi
- bin/ezreport
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"phpunit/phpunit": "^6.4"
},
"scripts": {
"fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating"
"fix-cs": "php-cs-fixer fix -v --show-progress=estimating",
"check-cs": "@fix-cs --dry-run",
"test": "phpunit -c phpunit-integration-legacy.xml"
},
"extra": {
"_ezplatform_branch_for_behat_tests": "2.5",
Expand Down

0 comments on commit fad3c2a

Please # to comment.