diff --git a/.gitattributes b/.gitattributes index 48a95b67..d2faa93c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,10 +7,10 @@ /.gitignore export-ignore /.scrutinizer.yml export-ignore /.styleci.yml export-ignore -/.travis.yml export-ignore /PULL_REQUEST_TEMPLATE.md export-ignore /ISSUE_TEMPLATE.md export-ignore /phpcs.xml.dist export-ignore /phpunit.xml.dist export-ignore /tests export-ignore /docs export-ignore +/.github export-ignore diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml new file mode 100644 index 00000000..01ab94ff --- /dev/null +++ b/.github/workflows/coding-standards.yml @@ -0,0 +1,51 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Check Coding Standards" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + coding-standards: + name: "Check Coding Standards" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "locked" + php-version: + - "7.4" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + tools: composer:v2 + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Coding Standard" + run: "vendor/bin/phpcs --standard=psr2 src/" diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 00000000..9b86644c --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,55 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "PHPUnit tests" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + phpunit: + name: "PHPUnit tests" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "lowest" + - "highest" + - "locked" + php-version: + - "7.3" + - "7.4" + - "8.0" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + tools: composer:v2 + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Tests" + run: "vendor/bin/phpunit" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 48273c62..00000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -dist: trusty -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - - hhvm - -## Cache composer -cache: - directories: - - $HOME/.composer/cache - -matrix: - include: - - php: 7.2 - env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"' - -before_script: - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist - -script: - - vendor/bin/phpcs --standard=psr2 src/ - - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - -after_script: - - | - if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover - fi