From 6fa6328545929a9d837a0f027ed3ec648e404715 Mon Sep 17 00:00:00 2001 From: Kamil Kokot Date: Thu, 5 Nov 2020 21:53:06 +0100 Subject: [PATCH] Switch from Travis to GitHub Actions --- .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++++++++ .travis.yml | 37 ------------------------ composer.json | 12 ++++---- 3 files changed, 62 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..79c6836 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,56 @@ +name: Build + +on: + push: ~ + pull_request: ~ + release: + types: [created] + schedule: + - + cron: "0 1 * * 6" # Run at 1am every Saturday + +jobs: + tests: + runs-on: ubuntu-latest + name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}" + strategy: + fail-fast: false + matrix: + php: ["7.3", "7.4", "8.0"] + symfony: ["4.4.*", "5.1.*"] + + steps: + - + uses: actions/checkout@v2 + + - + name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + coverage: none + + - + name: Update Symfony version + if: matrix.symfony != '' + run: | + composer require symfony/dependency-injection:${{ matrix.symfony }} --no-update --no-scripts + composer require symfony/http-kernel:${{ matrix.symfony }} --no-update --no-scripts + composer require symfony/proxy-manager-bridge:${{ matrix.symfony }} --no-update --no-scripts + + composer require --dev symfony/browser-kit:${{ matrix.symfony }} --no-update --no-scripts + composer require --dev symfony/framework-bundle:${{ matrix.symfony }} --no-update --no-scripts + composer require --dev symfony/process:${{ matrix.symfony }} --no-update --no-scripts + composer require --dev symfony/yaml:${{ matrix.symfony }} --no-update --no-scripts + + - + name: Install dependencies + run: composer update + + - + name: Run analysis + run: composer analyse + + - + name: Run tests + run: composer test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a5cf165..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: php - -php: - - '7.2' - - '7.3' - - '7.4' - - '8.0snapshot' - -env: - - SYMFONY_VERSION=4.4.* - - SYMFONY_VERSION=5.1.* - -cache: - directories: - - ~/.composer/cache/files - -before_install: - - phpenv config-rm xdebug.ini || true - - composer self-update --2 # Upgrade to Compose 2 (needed for PHP 8 support), only needed while it's not installed by default - -install: - - composer require symfony/dependency-injection:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist - - composer require symfony/http-kernel:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist - - composer require symfony/proxy-manager-bridge:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist - - - composer require --dev symfony/browser-kit:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist - - composer require --dev symfony/framework-bundle:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist - - composer require --dev symfony/process:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist - - composer require --dev symfony/yaml:${SYMFONY_VERSION} --no-update --no-scripts --prefer-dist - - # ignore-platform-req=php is necessary temporarily because PageObjectExtension isn't compatible with PHP8 yet: https://github.com/FriendsOfBehat/PageObjectExtension/pull/16 - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "8.0" ]]; then composer update --prefer-dist --ignore-platform-req=php; else composer update --prefer-dist; fi - -script: - - composer check - - - vendor/bin/behat -f progress --strict -vvv --no-interaction diff --git a/composer.json b/composer.json index 12bf568..c94fba5 100644 --- a/composer.json +++ b/composer.json @@ -46,16 +46,16 @@ "sort-packages": true }, "scripts": { - "check": [ - "composer validate --ansi --strict", - "@analyse" + "analyse": [ + "@composer validate --ansi --strict", + "vendor/bin/ecs check --ansi --no-progress-bar src tests", + "vendor/bin/psalm src --no-progress" ], "fix": [ "vendor/bin/ecs check --ansi --no-progress-bar src tests --fix" ], - "analyse": [ - "vendor/bin/ecs check --ansi --no-progress-bar src tests", - "vendor/bin/psalm src --no-progress" + "test": [ + "vendor/bin/behat -f progress --strict -vvv --no-interaction --colors" ] }, "extra": {