diff --git a/.github/workflows/mutation-tests.yml b/.github/workflows/mutation-tests.yml new file mode 100644 index 0000000..7e0c24d --- /dev/null +++ b/.github/workflows/mutation-tests.yml @@ -0,0 +1,59 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Mutation tests" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + mutation-tests: + name: "Mutation tests" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "locked" + php-version: + - "7.4" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Infection" + run: "vendor/bin/infection" diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..335fbd2 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,62 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "PHPUnit tests" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + phpunit: + name: "PHPUnit tests" + + runs-on: ${{ matrix.operating-system }} + + strategy: + matrix: + dependencies: + - "lowest" + - "highest" + - "locked" + php-version: + - "7.4" + operating-system: + - "ubuntu-latest" + - "windows-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Tests" + run: "vendor/bin/phpunit" diff --git a/.github/workflows/release-on-milestone-closed-triggering-release-event.yml b/.github/workflows/release-on-milestone-closed-triggering-release-event.yml new file mode 100644 index 0000000..2d88c94 --- /dev/null +++ b/.github/workflows/release-on-milestone-closed-triggering-release-event.yml @@ -0,0 +1,61 @@ +# Alternate workflow example. +# This one is identical to the one in release-on-milestone.yml, with one change: +# the Release step uses the ORGANIZATION_ADMIN_TOKEN instead, to allow it to +# trigger a release workflow event. This is useful if you have other actions +# that intercept that event. + +name: "Automatic Releases" + +on: + milestone: + types: + - "closed" + +jobs: + release: + name: "GIT tag, release & create merge-up PR" + runs-on: ubuntu-latest + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Release" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:release" + env: + "GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} + + - name: "Create Merge-Up Pull Request" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:create-merge-up-pull-request" + env: + "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} + + - name: "Create and/or Switch to new Release Branch" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor" + env: + "GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} + + - name: "Create new milestones" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:create-milestones" + env: + "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 7c2921a..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,10 +0,0 @@ -inherit: true - -before_commands: - - "composer install --prefer-source" - -tools: - external_code_coverage: - enabled: true - timeout: 600 - runs: 1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0333b55..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - -env: - matrix: - - COMPOSER_FLAGS="" - - COMPOSER_FLAGS="--prefer-lowest" - -stages: - - test - - test with coverage - - infection - -before_install: phpenv config-rm xdebug.ini || echo "xdebug not available" - -install: travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest $COMPOSER_FLAGS -vv - -script: vendor/bin/phpunit --colors --no-coverage - -jobs: - allow_failures: - - php: nightly - include: - - php: nightly - env: COMPOSER_FLAGS="--ignore-platform-reqs" - - - stage: test with coverage - php: 7.3 - env: COMPOSER_FLAGS="" - before_install: skip - script: vendor/bin/phpunit --colors --coverage-clover=clover.xml --coverage-text - after_success: - - wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover clover.xml - - - stage: infection - php: 7.3 - env: COMPOSER_FLAGS="" - before_install: skip - script: vendor/bin/infection --log-verbosity=none --threads=4 --min-covered-msi=68 --min-msi=68 diff --git a/composer.json b/composer.json index 0a73bf3..e86328c 100644 --- a/composer.json +++ b/composer.json @@ -3,14 +3,14 @@ "description": "Doctrine Cache adapter for PSR-16 Simple Cache", "type": "library", "require": { - "php": "^7.2,<7.5", + "php": "^7.4 || ~8.0.0", "doctrine/cache": "^1.7", "psr/simple-cache": "^1.0" }, "require-dev": { "cache/integration-tests": "dev-master", "cache/tag-interop": "dev-master", - "infection/infection": "^0.14.2", + "infection/infection": "^0.20.0", "phpunit/phpunit": "^8.4", "symfony/console": "^4.3", "symfony/phpunit-bridge": "^4.4@dev" diff --git a/infection.json.dist b/infection.json.dist index 5925b32..1f79a8a 100644 --- a/infection.json.dist +++ b/infection.json.dist @@ -4,12 +4,15 @@ "src" ] }, - "timeout": 10, "logs": { - "text": "infection-log.txt" + "text": "php:\/\/stderr", + "badge": { + "branch": "master" + } }, - "phpUnit": { - "configDir": ".", - "customPath": "vendor/bin/phpunit" - } + "mutators": { + "@default": true + }, + "minMsi": 81, + "minCoveredMsi": 81 }