From 1781400702539a5805a3bd15c69b2138223f79d8 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 24 Mar 2021 14:09:53 +0100 Subject: [PATCH] replace Travis CI with GitHub Actions --- .github/workflows/ci.yaml | 56 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 12 --------- composer.json | 3 ++- 3 files changed, 58 insertions(+), 13 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..951f6d4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,56 @@ +name: 'CI' + +on: + - 'push' + - 'pull_request' + +jobs: + tests: + name: 'Tests' + + runs-on: 'ubuntu-latest' + + strategy: + matrix: + include: + - php-version: '7.1' + composer-options: '--prefer-stable' + - php-version: '7.1' + composer-options: '--prefer-lowest --prefer-stable' + - php-version: '7.2' + composer-options: '--prefer-stable' + - php-version: '7.3' + composer-options: '--prefer-stable' + + steps: + - name: 'Check out' + uses: 'actions/checkout@v2' + + - name: 'Set up PHP' + uses: 'shivammathur/setup-php@v2' + with: + php-version: '${{ matrix.php-version }}' + coverage: 'none' + + - name: 'Get Composer cache directory' + id: 'composer-cache' + run: 'echo "::set-output name=cache-dir::$(composer config cache-files-dir)"' + + - name: 'Cache dependencies' + uses: 'actions/cache@v2' + with: + path: '${{ steps.composer-cache.outputs.cache-dir }}' + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: 'php-${{ matrix.php-version }}-composer-locked-' + + - name: 'Install dependencies' + run: 'composer update --no-progress $COMPOSER_OPTIONS' + + - name: 'Install PHPUnit' + run: 'vendor/bin/simple-phpunit install' + + - name: 'Run PhpSpec' + run: 'vendor/bin/phpspec run' + + - name: 'Run PHPUnit' + run: 'SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/simple-phpunit' diff --git a/.travis.yml b/.travis.yml index 6abe60c..ccec9bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,5 @@ -sudo: false - language: php -cache: - directories: - - $HOME/.composer/cache/files - env: global: - deps="" @@ -23,17 +17,11 @@ matrix: - php: 7.2 - php: 7.3 -before_install: - - if [[ "$xdebug" != "yes" ]]; then phpenv config-rm xdebug.ini; fi - - composer self-update - - composer require 'phpunit/phpunit:^4.8.35|^5.4.3|^6.0' --dev --no-update - install: - if [ "$PACKAGES" != "" ]; then composer require --no-update $PACKAGES; fi - composer update $COMPOSER_OPTIONS script: - - vendor/bin/phpspec run - if [[ "$xdebug" = "yes" ]]; then vendor/bin/phpunit --coverage-clover=coverage.clover; else vendor/bin/phpunit; fi - if [[ "$xdebug" = "yes" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi - if [[ "$xdebug" = "yes" ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi diff --git a/composer.json b/composer.json index c12bab6..15208f4 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "require-dev": { "phpspec/phpspec": "^2.4", "php-http/mock-client": "^1.2", - "php-xapi/test-fixtures": "^1.0" + "php-xapi/test-fixtures": "^1.0", + "symfony/phpunit-bridge": "^5.2" }, "minimum-stability": "dev", "suggest": {