diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 3e0cef3..0000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,4 +0,0 @@ - diff --git a/.github/workflows/close-pull-request.yml b/.github/workflows/close-pull-request.yml deleted file mode 100644 index 8130e2e..0000000 --- a/.github/workflows/close-pull-request.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Close Pull Request - -on: - pull_request_target: - types: [opened] - -jobs: - run: - runs-on: ubuntu-latest - steps: - - uses: superbrothers/close-pull-request@v3 - with: - comment: "We do not accept Pull Requests on GitHub! Please, open a PR in [GitLab](https://gitlab.com/aplus-framework/libraries/pagination)." diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d721a19 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,62 @@ +name: Tests + +on: + push: + pull_request: + schedule: + - cron: '0 4 * * *' + +jobs: + tests: + runs-on: ubuntu-20.04 + + strategy: + fail-fast: true + matrix: + php: ['8.0', '8.1'] + + name: PHP ${{ matrix.php }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer + coverage: xdebug + + - name: Install dependencies + run: + composer update + + - name: Composer normalize + run: + composer normalize --dry-run --indent-size=4 --indent-style=space + + - name: Coding Standard + run: + vendor/bin/php-cs-fixer fix --diff --dry-run --verbose + + - name: PHPMD + run: + vendor/bin/phpmd src xml phpmd.xml + + - name: PHPStan + run: + vendor/bin/phpstan analyse -vvv + + - name: PHPUnit + run: vendor/bin/phpunit --verbose + + - name: Upload coverage results to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p build/logs/ + cp build/coverage/clover.xml build/logs/clover.xml + composer global require php-coveralls/php-coveralls + php-coveralls --coverage_clover=build/logs/clover.xml -v + if: matrix.php == '8.0'