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 39eb40a..ce505b5 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 Named Binary Tags