diff --git a/.dependabot/config.yml b/.dependabot/config.yml index a3bd09e6..6825a80a 100644 --- a/.dependabot/config.yml +++ b/.dependabot/config.yml @@ -3,7 +3,10 @@ version: 1 update_configs: - - default_assignees: + - automerged_updates: + - match: + dependency_type: "development" + default_assignees: - "localheinz" default_labels: - "dependency" diff --git a/.github/settings.yml b/.github/settings.yml index e7f323ae..3fe7fb42 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,7 +1,11 @@ # https://github.com/probot/settings branches: - - name: master + - name: "master" + + # https://developer.github.com/v3/repos/branches/#remove-branch-protection + # https://developer.github.com/v3/repos/branches/#update-branch-protection + protection: enforce_admins: false required_pull_request_reviews: @@ -30,37 +34,56 @@ branches: - "codecov/patch" - "codecov/project" strict: false - restrictions: null + restrictions: + apps: + - "dependabot-preview" + teams: [] + users: [] + +# https://developer.github.com/v3/issues/labels/#create-a-label +# https://developer.github.com/v3/issues/labels/#update-a-label labels: - - name: bug - color: ee0701 + - name: "bug" + color: "#ee0701" + description: "" - - name: dependency - color: 0366d6 + - name: "dependency" + color: "#0366d6" + description: "" - - name: enhancement - color: 0e8a16 + - name: "enhancement" + color: "#0e8a16" + description: "" - - name: question - color: cc317c + - name: "question" + color: "#cc317c" + description: "" - - name: security - color: ee0701 + - name: "security" + color: "#ee0701" + description: "" - - name: stale - color: eeeeee + - name: "stale" + color: "#eeeeee" + description: "" + +# https://developer.github.com/v3/repos/#edit repository: allow_merge_commit: true allow_rebase_merge: false allow_squash_merge: false - default_branch: master + default_branch: "master" description: ":eyeglasses: Provides utilities for tests." has_downloads: true has_issues: true has_pages: false has_projects: false has_wiki: false - name: test-util + name: "test-util" private: false + + # https://developer.github.com/v3/repos/branches/#remove-branch-protection + + topics: "phpunit, phpunit-util, phpunit-assertions, faker" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 05271a78..579da013 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,287 +4,285 @@ on: pull_request: push: branches: - - master + - "master" tags: - "**" name: "Continuous Integration" +env: + MIN_COVERED_MSI: 95 + MIN_MSI: 95 + REQUIRED_PHP_EXTENSIONS: "mbstring" + jobs: coding-standards: name: "Coding Standards" - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" strategy: matrix: php-version: - - 7.1 + - "7.1" dependencies: - - locked + - "locked" steps: - name: "Checkout" - uses: actions/checkout@v2.0.0 + uses: "actions/checkout@v2.0.0" - name: "Install PHP with extensions" - uses: shivammathur/setup-php@1.6.1 + uses: "shivammathur/setup-php@1.6.2" with: - coverage: none - extensions: "mbstring" - php-version: ${{ matrix.php-version }} + coverage: "none" + extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + php-version: "${{ matrix.php-version }}" - name: "Validate composer.json and composer.lock" - run: composer validate --strict + run: "composer validate --strict" - name: "Cache dependencies installed with composer" - uses: actions/cache@v1.0.3 + uses: "actions/cache@v1.0.3" with: - path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress --no-suggest + run: "composer install --no-interaction --no-progress --no-suggest" - name: "Run ergebnis/composer-normalize" - run: composer normalize --dry-run + run: "composer normalize --dry-run" - name: "Create cache directory for friendsofphp/php-cs-fixer" - run: mkdir -p .build/php-cs-fixer + run: "mkdir -p .build/php-cs-fixer" - name: "Cache cache directory for friendsofphp/php-cs-fixer" - uses: actions/cache@v1.0.3 + uses: "actions/cache@v1.0.3" with: - path: .build/php-cs-fixer - key: php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - php-${{ matrix.php-version }}-php-cs-fixer- + path: ".build/php-cs-fixer" + key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-" - name: "Run friendsofphp/php-cs-fixer" - run: vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose + run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose" - name: "Run friendsofphp/php-cs-fixer for test fixtures" - run: vendor/bin/php-cs-fixer fix --config=.php_cs.fixture --diff --diff-format=udiff --using-cache=no --verbose + run: "vendor/bin/php-cs-fixer fix --config=.php_cs.fixture --diff --diff-format=udiff --using-cache=no --verbose" dependency-analysis: name: "Dependency Analysis" - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" strategy: matrix: php-version: - - 7.4 + - "7.4" dependencies: - - locked + - "locked" steps: - name: "Checkout" - uses: actions/checkout@v2.0.0 + uses: "actions/checkout@v2.0.0" - name: "Install PHP with extensions" - uses: shivammathur/setup-php@1.6.1 + uses: "shivammathur/setup-php@1.6.2" with: - coverage: none - extensions: "mbstring" - php-version: ${{ matrix.php-version }} + coverage: "none" + extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + php-version: "${{ matrix.php-version }}" - name: "Cache dependencies installed with composer" - uses: actions/cache@v1.0.3 + uses: "actions/cache@v1.0.3" with: - path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress --no-suggest + run: "composer install --no-interaction --no-progress --no-suggest" - name: "Run maglnet/composer-require-checker" - uses: docker://webfactory/composer-require-checker:2.0.0 + uses: "docker://webfactory/composer-require-checker:2.0.0" with: - args: check --config-file=composer-require-checker.json + args: "check --config-file=composer-require-checker.json" static-code-analysis: name: "Static Code Analysis" - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" strategy: matrix: php-version: - - 7.4 + - "7.4" dependencies: - - locked + - "locked" steps: - name: "Checkout" - uses: actions/checkout@v2.0.0 + uses: "actions/checkout@v2.0.0" - name: "Install PHP with extensions" - uses: shivammathur/setup-php@1.6.1 + uses: "shivammathur/setup-php@1.6.2" with: - coverage: none - extensions: "mbstring" - php-version: ${{ matrix.php-version }} + coverage: "none" + extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + php-version: "${{ matrix.php-version }}" - name: "Cache dependencies installed with composer" - uses: actions/cache@v1.0.3 + uses: "actions/cache@v1.0.3" with: - path: ~/.composer/cache - key: ${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ matrix.php-version }}-composer-locked- + path: "~/.composer/cache" + key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }}" + restore-keys: "${{ matrix.php-version }}-composer-locked-" - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress --no-suggest + run: "composer install --no-interaction --no-progress --no-suggest" - name: "Run phpstan/phpstan" - run: vendor/bin/phpstan analyse --configuration=phpstan.neon + run: "vendor/bin/phpstan analyse --configuration=phpstan.neon" tests: name: "Tests" - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" strategy: matrix: php-version: - - 7.1 - - 7.2 - - 7.3 - - 7.4 + - "7.1" + - "7.2" + - "7.3" + - "7.4" dependencies: - - lowest - - locked - - highest + - "lowest" + - "locked" + - "highest" steps: - name: "Checkout" - uses: actions/checkout@v2.0.0 + uses: "actions/checkout@v2.0.0" - name: "Install PHP with extensions" - uses: shivammathur/setup-php@1.6.1 + uses: "shivammathur/setup-php@1.6.2" with: - coverage: none - extensions: "mbstring" - php-version: ${{ matrix.php-version }} + coverage: "none" + extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + php-version: "${{ matrix.php-version }}" - name: "Cache dependencies installed with composer" - uses: actions/cache@v1.0.3 + uses: "actions/cache@v1.0.3" with: - path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - name: "Install lowest dependencies with composer" - if: matrix.dependencies == 'lowest' - run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest + if: "matrix.dependencies == 'lowest'" + run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest" - name: "Install locked dependencies with composer" - if: matrix.dependencies == 'locked' - run: composer install --no-interaction --no-progress --no-suggest + if: "matrix.dependencies == 'locked'" + run: "composer install --no-interaction --no-progress --no-suggest" - name: "Install highest dependencies with composer" - if: matrix.dependencies == 'highest' - run: composer update --no-interaction --no-progress --no-suggest + if: "matrix.dependencies == 'highest'" + run: "composer update --no-interaction --no-progress --no-suggest" - name: "Run auto-review tests with phpunit/phpunit" - run: vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml + run: "vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml" - name: "Run unit tests with phpunit/phpunit" - run: vendor/bin/phpunit --configuration=test/Unit/phpunit.xml + run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml" - name: "Run integration tests with phpunit/phpunit" - run: vendor/bin/phpunit --configuration=test/Integration/phpunit.xml + run: "vendor/bin/phpunit --configuration=test/Integration/phpunit.xml" code-coverage: name: "Code Coverage" - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" strategy: matrix: php-version: - - 7.4 + - "7.4" dependencies: - - locked + - "locked" steps: - name: "Checkout" - uses: actions/checkout@v2.0.0 + uses: "actions/checkout@v2.0.0" - name: "Install PHP with extensions" - uses: shivammathur/setup-php@1.6.1 + uses: "shivammathur/setup-php@1.6.2" with: - coverage: xdebug - extensions: "mbstring" - php-version: ${{ matrix.php-version }} + coverage: "xdebug" + extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + php-version: "${{ matrix.php-version }}" - name: "Cache dependencies installed with composer" - uses: actions/cache@v1.0.3 + uses: "actions/cache@v1.0.3" with: - path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress --no-suggest + run: "composer install --no-interaction --no-progress --no-suggest" - name: "Dump Xdebug filter with phpunit/phpunit" - run: vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php + run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php" - name: "Collect code coverage with Xdebug and phpunit/phpunit" - run: vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=build/logs/clover.xml --prepend=.build/phpunit/xdebug-filter.php + run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=.build/logs/clover.xml --prepend=.build/phpunit/xdebug-filter.php" - name: "Send code coverage report to Codecov.io" env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - run: bash <(curl -s https://codecov.io/bash) + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" + run: "bash <(curl -s https://codecov.io/bash)" mutation-tests: name: "Mutation Tests" - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" strategy: matrix: php-version: - - 7.4 + - "7.4" dependencies: - - locked + - "locked" steps: - name: "Checkout" - uses: actions/checkout@v2.0.0 + uses: "actions/checkout@v2.0.0" - name: "Install PHP with extensions" - uses: shivammathur/setup-php@1.6.1 + uses: "shivammathur/setup-php@1.6.2" with: - coverage: xdebug - extensions: "mbstring" - php-version: ${{ matrix.php-version }} + coverage: "xdebug" + extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}" + php-version: "${{ matrix.php-version }}" - name: "Cache dependencies installed with composer" - uses: actions/cache@v1.0.3 + uses: "actions/cache@v1.0.3" with: - path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - name: "Install locked dependencies with composer" - run: composer install --no-interaction --no-progress --no-suggest + run: "composer install --no-interaction --no-progress --no-suggest" - - name: "Run mutation tests with Xdebug and infection/infection" - run: vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=95 --min-msi=95 + - name: "Run mutation tests with pcov and infection/infection" + run: "vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${{ env.MIN_COVERED_MSI }} --min-msi=${{ env.MIN_MSI }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8125fd9e..90a675b1 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,11 +8,12 @@ on: jobs: stale: - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" + steps: - - uses: actions/stale@v1 + - uses: "actions/stale@v1.1.0" with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token: "${{ secrets.GITHUB_TOKEN }}" days-before-stale: 60 days-before-close: 5 stale-issue-label: 'stale' @@ -24,4 +25,4 @@ jobs: This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. - stale-pr-label: 'stale' + stale-pr-label: "stale" diff --git a/Makefile b/Makefile index 9fbc8652..36955f8d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +MIN_COVERED_MSI:=95 +MIN_MSI:=95 + .PHONY: it it: coding-standards dependency-analysis static-code-analysis tests ## Runs the coding-standards, dependency-analysis, static-code-analysis, and tests targets @@ -24,7 +27,7 @@ help: ## Displays this list of targets with descriptions .PHONY: mutation-tests mutation-tests: vendor ## Runs mutation tests with infection/infection mkdir -p .build/infection - vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=95 --min-msi=95 + vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${MIN_COVERED_MSI} --min-msi=${MIN_MSI} .PHONY: static-code-analysis static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan