diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4398848 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + test: + name: PHP ${{ matrix.php }}${{ matrix.prefer_lowest == '--prefer-lowest' && ' (lowest)' || '' }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: ['7.4'] + prefer_lowest: ['', '--prefer-lowest'] + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + tools: composer:v2 + + - name: Get Composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT" + + - name: Cache Composer packages + uses: actions/cache@v5 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ matrix.php }}-${{ matrix.prefer_lowest }}-${{ hashFiles('composer.json') }} + restore-keys: | + composer-${{ matrix.php }}- + + - name: Pin Composer platform to the runtime PHP version + run: composer config platform.php "$(php -r 'echo PHP_VERSION;')" + + - name: Install dependencies + run: composer update --no-interaction --prefer-dist ${{ matrix.prefer_lowest }} + + - name: Lint (phpcs) + run: vendor/bin/phpcs -p --warning-severity=0 src/ tests/ + + - name: Unit tests + run: vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c4169e4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: php - -dist: trusty - -## Cache composer bits -cache: - directories: - - $HOME/.composer/cache/files - -php: - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - nightly - -env: - - PREFER_LOWEST=--prefer-lowest - - PREFER_LOWEST= - -matrix: - allow_failures: - - php: 7.4 - - php: nightly - -before_script: - - composer config platform.php $(php -r "echo PHP_VERSION;") - - travis_retry composer update --no-interaction --prefer-dist $PREFER_LOWEST - -script: - - vendor/bin/phpcs -p --warning-severity=0 src/ tests/ - - vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover - -after_script: - - test -f ./tests/report/coverage.clover && (wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./tests/report/coverage.clover) diff --git a/README.md b/README.md index 3564f02..28e9807 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/graze/parallel-process.svg?style=flat-square)](https://packagist.org/packages/graze/parallel-process) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/travis/graze/parallel-process/master.svg?style=flat-square)](https://travis-ci.org/graze/parallel-process) -[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/graze/parallel-process.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/parallel-process/code-structure) -[![Quality Score](https://img.shields.io/scrutinizer/g/graze/parallel-process.svg?style=flat-square)](https://scrutinizer-ci.com/g/graze/parallel-process) +[![Build Status](https://img.shields.io/github/actions/workflow/status/graze/parallel-process/ci.yml?branch=master&style=flat-square)](https://github.com/graze/parallel-process/actions/workflows/ci.yml) [![Total Downloads](https://img.shields.io/packagist/dt/graze/parallel-process.svg?style=flat-square)](https://packagist.org/packages/graze/parallel-process) Run multiple `Symfony\Process`'s at the same time.