diff --git a/.dependabot/config.yml b/.dependabot/config.yml index 34a610d3..1dca0d76 100644 --- a/.dependabot/config.yml +++ b/.dependabot/config.yml @@ -3,6 +3,14 @@ version: 1 update_configs: + - default_assignees: + - "localheinz" + default_reviewers: + - "localheinz" + directory: "/" + package_manager: "github_actions" + update_schedule: "daily" + - default_assignees: - "localheinz" default_reviewers: diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 81b1a7fc..04824461 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -50,6 +50,8 @@ $ make to enforce coding standards, perform a static code analysis, and run tests! +## Help + :bulb: Run ``` diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e655dbfc..2cfd4577 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,3 @@ +custom: https://www.buymeacoffee.com/localheinz github: localheinz patreon: localheinz diff --git a/.github/settings.yml b/.github/settings.yml index bedf4eae..c20b5fee 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -67,6 +67,9 @@ labels: - name: question color: cc317c + - name: security + color: ee0701 + - name: stale color: eeeeee diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 6a8879d6..c67c797b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,8 +1,13 @@ # https://help.github.com/en/categories/automating-your-workflow-with-github-actions on: - - pull_request - - push + pull_request: + push: + branches: + - master + - "1.x" + tags: + - "**" name: "Continuous Integration" @@ -14,13 +19,24 @@ jobs: steps: - name: "Checkout" - uses: actions/checkout@master + uses: actions/checkout@v1.1.0 + + - name: "Disable Xdebug" + run: php7.1 --ini | grep xdebug | sed 's/,$//' | xargs sudo rm - name: "Validate composer.json and composer.lock" - run: php7.1 /usr/bin/composer validate --strict + run: php7.1 $(which composer) validate --strict + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1.0.0 + with: + path: ~/.composer/cache + key: php7.1-composer-locked-${{ hashFiles('**/composer.lock') }} + restore-keys: | + php7.1-composer-locked- - name: "Install locked dependencies with composer" - run: php7.1 /usr/bin/composer install + run: php7.1 $(which composer) install --no-interaction --no-progress --no-suggest - name: "Run friendsofphp/php-cs-fixer" run: php7.1 vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --using-cache=no --verbose @@ -32,10 +48,21 @@ jobs: steps: - name: "Checkout" - uses: actions/checkout@master + uses: actions/checkout@v1.1.0 + + - name: "Disable Xdebug" + run: php7.3 --ini | grep xdebug | sed 's/,$//' | xargs sudo rm + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1.0.0 + with: + path: ~/.composer/cache + key: php7.3-composer-locked-${{ hashFiles('**/composer.lock') }} + restore-keys: | + php7.3-composer-locked- - name: "Install locked dependencies with composer" - run: php7.3 /usr/bin/composer install + run: php7.3 $(which composer) install --no-interaction --no-progress --no-suggest - name: "Run phpstan/phpstan" run: php7.3 vendor/bin/phpstan analyse --configuration=phpstan.neon @@ -59,19 +86,33 @@ jobs: steps: - name: "Checkout" - uses: actions/checkout@master + uses: actions/checkout@v1.1.0 + + - name: "Disable Xdebug" + run: ${{ matrix.php-binary }} --ini | grep xdebug | sed 's/,$//' | xargs sudo rm + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1.0.0 + with: + path: ~/.composer/cache + key: ${{ matrix.php-binary }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ matrix.php-binary }}-composer-${{ matrix.dependencies }}- - name: "Install lowest dependencies with composer" if: matrix.dependencies == 'lowest' - run: ${{ matrix.php-binary }} /usr/bin/composer update --prefer-lowest + run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest - name: "Install locked dependencies with composer" if: matrix.dependencies == 'locked' - run: ${{ matrix.php-binary }} /usr/bin/composer install + run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest - name: "Install highest dependencies with composer" if: matrix.dependencies == 'highest' - run: ${{ matrix.php-binary }} /usr/bin/composer update + run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest + + - name: "Run integration tests with phpunit/phpunit" + run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=test/Integration/phpunit.xml - name: "Run integration tests with phpunit/phpunit" run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=test/Integration/phpunit.xml @@ -83,10 +124,18 @@ jobs: steps: - name: "Checkout" - uses: actions/checkout@master + uses: actions/checkout@v1.1.0 + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1.0.0 + with: + path: ~/.composer/cache + key: php7.3-composer-locked-${{ hashFiles('**/composer.lock') }} + restore-keys: | + php7.3-composer-locked- - name: "Install locked dependencies with composer" - run: php7.3 /usr/bin/composer install + run: php7.3 $(which composer) install --no-interaction --no-progress --no-suggest - name: "Dump Xdebug filter with phpunit/phpunit" run: php7.3 vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php @@ -94,8 +143,7 @@ jobs: - name: "Collect code coverage with Xdebug and phpunit/phpunit" run: php7.3 vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --coverage-clover=build/logs/clover.xml --prepend=.build/phpunit/xdebug-filter.php - - name: "Download code coverage uploader for Codecov.io" - run: curl -s https://codecov.io/bash -o codecov - - name: "Send code coverage report to Codecov.io" - run: bash codecov -t ${{ secrets.CODECOV_TOKEN }} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index fd561379..ed27c459 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,6 +1,7 @@ # https://github.com/actions/stale name: "Close stale issues and pull requests" + on: schedule: - cron: "0 * * * *" diff --git a/Makefile b/Makefile index ac4a796c..a4c0db67 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -.PHONY: coverage cs help it stan test +.PHONY: coverage cs help infection it stan test it: cs stan test ## Runs the cs, stan, and test targets -coverage: vendor ## Collects coverage from running unit tests with phpunit +coverage: vendor ## Collects coverage from running integration tests with phpunit mkdir -p .build/phpunit vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php vendor/bin/phpunit --configuration=test/Integration/phpunit.xml --coverage-text --prepend=.build/phpunit/xdebug-filter.php @@ -24,4 +24,4 @@ test: vendor ## Runs auto-review, unit, and integration tests with phpunit vendor: composer.json composer.lock composer validate --strict - composer install + composer install --no-interaction --no-progress --no-suggest