From f7f85ed99a608987a175d238b3f8e28f7158fd9b Mon Sep 17 00:00:00 2001 From: piotrbisaga Date: Mon, 13 Sep 2021 16:44:57 +0200 Subject: [PATCH 1/5] IBX-829 [CI] Moved jobs to Github Actions --- .github/workflows/ci.yaml | 50 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 16 +++---------- composer.json | 4 +++- 3 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6bc11db --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: + - $default-branch + - '[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] + + 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 + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 766c3fc..ce1d1a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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 @@ -68,4 +58,4 @@ after_failure: - docker ps -s after_script: - - if [ "${BEHAT_OPTS}" != "" ] ; then bin/ezreport ; fi + - bin/ezreport diff --git a/composer.json b/composer.json index a6c3a5d..c225af6 100644 --- a/composer.json +++ b/composer.json @@ -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", From 81a2bade102ef9d71893da153069e20d3b974aa7 Mon Sep 17 00:00:00 2001 From: piotrbisaga Date: Thu, 16 Sep 2021 10:26:13 +0200 Subject: [PATCH 2/5] IBX-829-small-correction --- .github/workflows/ci.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6bc11db..5cbfb78 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - $default-branch + - master - '[0-9]+.[0-9]+' pull_request: ~ @@ -46,5 +46,4 @@ jobs: run: composer run-script check-cs -- --format=checkstyle | cs2pr - name: Run test suite - run: composer run-script --timeout=600 test - \ No newline at end of file + run: composer run-script --timeout=600 test \ No newline at end of file From c6037204902dbda49bee11e82d3e0defb1ebfb77 Mon Sep 17 00:00:00 2001 From: piotrbisaga Date: Thu, 16 Sep 2021 10:41:27 +0200 Subject: [PATCH 3/5] IBX-829-adjusting-GHactions --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5cbfb78..c7c6997 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,4 +46,5 @@ jobs: run: composer run-script check-cs -- --format=checkstyle | cs2pr - name: Run test suite - run: composer run-script --timeout=600 test \ No newline at end of file + run: composer run-script --timeout=600 test + \ No newline at end of file From 8d0a29ab8de376a70c07b799bc3ffe8fbea66d23 Mon Sep 17 00:00:00 2001 From: piotrbisaga Date: Thu, 16 Sep 2021 10:46:08 +0200 Subject: [PATCH 4/5] IBX-829-adjustment --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c7c6997..26aa98e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,4 +47,3 @@ jobs: - name: Run test suite run: composer run-script --timeout=600 test - \ No newline at end of file From f16348046ce0bd484311d540469166d7021a5c99 Mon Sep 17 00:00:00 2001 From: piotrbisaga Date: Thu, 23 Sep 2021 11:22:10 +0200 Subject: [PATCH 5/5] IBX-829 review fixes --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 26aa98e..7eaea89 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,10 +18,10 @@ jobs: matrix: php: - '7.1' + - '7.2' - '7.3' - '7.4' composer_options: [ "" ] - experimental: [false] steps: - uses: actions/checkout@v2