diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..765e416 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,33 @@ +name: tests +on: + push: + pull_request: + schedule: + - cron: '0 0 * * *' +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.4, 8.0, 8.1] + name: PHP - ${{ matrix.php }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip + tools: composer:v2 + coverage: none + - name: Install dependencies + run: | + composer update --prefer-dist --no-interaction --no-progress + - name: PHPStan + run: | + composer require "phpstan/phpstan:0.12.99" + vendor/bin/phpstan analyse --no-progress + - name: Execute tests + run: vendor/bin/phpunit --verbose diff --git a/.phpstan.ignoreErrors.neon b/.phpstan.ignoreErrors.neon new file mode 100644 index 0000000..ada8f6e --- /dev/null +++ b/.phpstan.ignoreErrors.neon @@ -0,0 +1,2 @@ +parameters: + ignoreErrors: [] \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2d1f85b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -php: -- 5.6 -- 7.0 -- 7.1 -- 7.2 -- 7.3 -- nightly - -matrix: - allow_failures: - - php: nightly - -dist: trusty -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -install: -- travis_retry composer install --no-interaction - -script: -- composer validate --strict -- find src tests -name *.php | xargs -n 1 -P4 php -l -- vendor/bin/phpunit diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..f71d635 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + level: 1 + paths: + - %currentWorkingDirectory%/src + - %currentWorkingDirectory%/tests + excludes_analyse: + - %currentWorkingDirectory%/vendor +includes: + - .phpstan.ignoreErrors.neon \ No newline at end of file