diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..5c455e2 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [veewee] diff --git a/.github/ISSUE_TEMPLATE/Bug.md b/.github/ISSUE_TEMPLATE/Bug.md new file mode 100644 index 0000000..2e7d29c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug.md @@ -0,0 +1,34 @@ +--- +name: 🐞 Bug Report +about: Something is broken? 🔨 +--- + +### Bug Report + + + +| Q | A +|------------ | ------ +| BC Break | yes/no +| Version | x.y.z + +#### Summary + + + +#### Current behaviour + + + +#### How to reproduce + + + +#### Expected behaviour + + + diff --git a/.github/ISSUE_TEMPLATE/Feature_Request.md b/.github/ISSUE_TEMPLATE/Feature_Request.md new file mode 100644 index 0000000..2620581 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_Request.md @@ -0,0 +1,18 @@ +--- +name: 🎉 Feature Request +about: You have a neat idea that should be implemented? 🎩 +--- + +### Feature Request + + + +| Q | A +|------------ | ------ +| New Feature | yes +| RFC | yes/no +| BC Break | yes/no + +#### Summary + + diff --git a/.github/ISSUE_TEMPLATE/Support_Question.md b/.github/ISSUE_TEMPLATE/Support_Question.md new file mode 100644 index 0000000..813fb01 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Support_Question.md @@ -0,0 +1,15 @@ +--- +name: ❓ Support Question +about: Have a problem that you can't figure out? 🤔 +--- + + + +| Q | A +|------------ | ----- +| Version | x.y.z + + +### Support Question + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d88b155 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ + + +| Q | A +|------------- | ----------- +| Type | bug/feature/improvement +| BC Break | yes/no +| Fixed issues | + +#### Summary + + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5a98fda --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: composer + directory: "/" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 diff --git a/.github/workflows/analyzers.yaml b/.github/workflows/analyzers.yaml new file mode 100644 index 0000000..2088d66 --- /dev/null +++ b/.github/workflows/analyzers.yaml @@ -0,0 +1,30 @@ +name: Analyzers + +on: + pull_request: ~ + push: ~ + schedule: + - cron: '0 9 * * 5' + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['8.1', '8.2', '8.3'] + fail-fast: false + name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@master + - name: Install PHP + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + tools: 'composer:v2' + extensions: pcov, mbstring, posix, xdebug, dom, libxml, xml, xsl, xmlreader, xmlwriter + - name: Install dependencies + run: composer update --ignore-platform-req=php --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} + - name: Run the tests + run: composer run psalm diff --git a/.github/workflows/code-style.yaml b/.github/workflows/code-style.yaml new file mode 100644 index 0000000..af69743 --- /dev/null +++ b/.github/workflows/code-style.yaml @@ -0,0 +1,29 @@ +name: CodeStyle + +on: [push, pull_request] + +env: + PHP_CS_FIXER_IGNORE_ENV: 1 + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['8.1', '8.2', '8.3'] + fail-fast: false + name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@master + - name: Install PHP + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + tools: 'composer:v2' + extensions: pcov, mbstring, posix + - name: Install dependencies + run: composer --ignore-platform-req=php update --prefer-dist --no-progress --no-suggest ${{ matrix.composer-options }} + - name: Run the tests + run: composer run cs diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..be91503 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,34 @@ +name: Tests + +on: + pull_request: ~ + push: ~ + schedule: + - cron: '0 9 * * 5' + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['8.1', '8.2', '8.3'] + experimental: [false] + fail-fast: false + name: PHP ${{ matrix.php-versions }} @ ${{ matrix.operating-system }} + steps: + - name: Checkout + uses: actions/checkout@master + - name: Install PHP + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php-versions }} + tools: 'composer:v2' + ini-values: error_reporting=E_ALL + extensions: pcov, mbstring, posix, dom, libxml, xml, xsl, xmlreader, xmlwriter + - name: Install dependencies + run: composer update --ignore-platform-req=php --prefer-dist --no-progress --no-suggest + - name: Run the tests + run: composer run tests + - name: Check tests quality + run: composer run testquality diff --git a/composer.json b/composer.json index 7842b82..5beb479 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,29 @@ "require-dev": { "vimeo/psalm": "^5.15", "phpunit/phpunit": "^10.4", - "friendsofphp/php-cs-fixer": "^3.38" + "friendsofphp/php-cs-fixer": "^3.38", + "veewee/composer-run-parallel": "^1.3", + "infection/infection": "^0.27.8" + }, + "scripts": { + "cs": "PHP_CS_FIXER_IGNORE_ENV=1 php ./vendor/bin/php-cs-fixer.phar fix --dry-run", + "cs:fix": "PHP_CS_FIXER_IGNORE_ENV=1 php ./vendor/bin/php-cs-fixer.phar fix", + "psalm": "./vendor/bin/psalm --no-cache --stats", + "tests": "./vendor/bin/phpunit.phar --coverage-text --color", + "infection": [ + "Composer\\Config::disableProcessTimeout", + "./vendor/bin/infection --show-mutations -v" + ], + "ci": [ + "@autoload", + "@parallel cs psalm tests", + "@parallel coverage infection" + ] + }, + "config": { + "allow-plugins": { + "veewee/composer-run-parallel": true, + "infection/extension-installer": true + } } } diff --git a/infection.json.dist b/infection.json.dist new file mode 100644 index 0000000..74fb124 --- /dev/null +++ b/infection.json.dist @@ -0,0 +1,21 @@ +{ + "source": { + "directories": [ + "src" + ] + }, + "minMsi": 100, + "minCoveredMsi": 100, + "logs": { + "text": ".phpunit.cache/infection.log", + "html": ".phpunit.cache/infection" + }, + "mutators": { + "@default": true, + "CastInt": { + "ignore": [ + "VeeWee\\Reflecta\\*Exception::__construct" + ] + } + } +}