Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-829 [CI] Moved CS and PHPUnit jobs to Github Actions #60

Merged
merged 5 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.3'
- '7.4'
composer_options: [ "" ]
experimental: [false]
Copy link
Member

Choose a reason for hiding this comment

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

Unused, could be removed?


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