diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6096735 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]')" + strategy: + matrix: + php: ['7.2', '7.3', '7.4'] + name: PHP ${{ matrix.php }} + steps: + - uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@2.9.0 + with: + php-version: ${{ matrix.php }} + ini-values: xdebug.max_nesting_level=3000 + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v2 + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "php-${{ matrix.php }}-composer-" + - name: Install dependencies + run: composer install --prefer-dist --no-interaction + - name: Run PHPStan + run: ./vendor/bin/phpstan analyze --no-progress + - name: Run PHPUnit + run: ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5caf0c6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - -before_script: - - composer install --prefer-dist - - echo 'xdebug.max_nesting_level=3000' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - -script: - - ./vendor/bin/phpstan analyze --no-progress - - ./vendor/bin/phpunit --bootstrap vendor/autoload.php --fail-on-warning tests/phpunit - -cache: - directories: - - vendor - -notifications: - email: false diff --git a/README.md b/README.md index afbe39b..44aa066 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # PocketMine-NBT -[![Build Status](https://travis-ci.org/pmmp/NBT.svg?branch=master)](https://travis-ci.org/pmmp/NBT) +![CI](https://github.com/pmmp/NBT/workflows/CI/badge.svg) PHP library for working with the NBT (Named Binary Tag) data storage format, as designed by Mojang. diff --git a/composer.json b/composer.json index 2fdd5d1..89e3928 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "pocketmine/binaryutils": "dev-master" }, "require-dev": { - "phpstan/phpstan": "0.12.40", + "phpstan/phpstan": "0.12.59", "irstea/phpunit-shim": "^7.5 || ^8.0", "phpstan/extension-installer": "^1.0", "phpstan/phpstan-strict-rules": "^0.12.4" diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index 3f50b95..eb10f65 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -1,10 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Call to function assert\\(\\) with bool will always evaluate to true\\.$#" - count: 2 - path: ../../../src/tag/CompoundTag.php - - message: "#^Call to function is_int\\(\\) with int will always evaluate to true\\.$#" count: 1