Skip to content

Commit

Permalink
Update development toolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Jun 21, 2021
1 parent 4ff6f07 commit 918bd85
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# When a PR is opened or a push is made, compare
# code for backwards compatibility.
name: RoaveBC

on:
pull_request:
branches:
- develop
paths:
- 'src/**'

jobs:
compare:
name: Compare for Backwards Compatibility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Run comparison (limited)
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
uses: docker://nyholm/roave-bc-check-ga

- name: Run comparison (authenticated)
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
uses: docker://nyholm/roave-bc-check-ga
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
31 changes: 30 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: composer, pecl, phpunit
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -55,7 +55,36 @@ jobs:
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Enable Tachycardia
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV

- name: Test with PHPUnit
run: vendor/bin/phpunit --verbose --coverage-text
env:
TERM: xterm-256color

- if: matrix.php-versions == '8.0'
name: Mutate with Infection
run: |
composer global require infection/infection
git fetch --depth=1 origin $GITHUB_BASE_REF
infection --threads=2 --skip-initial-tests --coverage=build/phpunit --git-diff-base=origin/$GITHUB_BASE_REF --git-diff-filter=AM --logger-github --ignore-msi-with-no-mutations
- if: matrix.php-versions == '8.0'
name: Run Coveralls
run: vendor/bin/php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: PHP ${{ matrix.php-versions }}

coveralls:
needs: [main]
name: Coveralls Finished
runs-on: ubuntu-latest
steps:
- name: Upload Coveralls results
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
"codeigniter4/codeigniter4": "dev-develop",
"codeigniter4/codeigniter4-standard": "^1.0",
"fakerphp/faker": "^1.9",
"friendsofphp/php-cs-fixer": "^3.0",
"mockery/mockery": "^1.0",
"nexusphp/cs-config": "^3.1",
"nexusphp/tachycardia": "^1.0",
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^9.2",
"squizlabs/php_codesniffer": "^3.5"
"phpunit/phpunit": "^9.2"
},
"autoload": {
"psr-4": {
Expand All @@ -55,7 +58,8 @@
"prefer-stable": true,
"scripts": {
"analyze": "phpstan analyze",
"style": "phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 tests/ src/",
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
"style": "php-cs-fixer fix --verbose --ansi",
"test": "phpunit"
}
}
19 changes: 19 additions & 0 deletions infection.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"source": {
"directories": [
"src"
],
"excludes": [
"Config",
"Database/Migrations",
"Views"
]
},
"logs": {
"text": "build/infection.log"
},
"mutators": {
"@default": true
},
"bootstrap": "vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php"
}
1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parameters:
- '#Cannot access property [\$a-z_]+ on (array|object)#'
universalObjectCratesClasses:
- CodeIgniter\Entity
- CodeIgniter\Entity\Entity
- Faker\Generator
scanDirectories:
- vendor/codeigniter4/codeigniter4/system/Helpers
Expand Down
33 changes: 32 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php"
backupGlobals="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
executionOrder="random"
failOnRisky="true"
failOnWarning="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
verbose="true">

<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
<include>
Expand All @@ -36,6 +42,30 @@
</testsuite>
</testsuites>

<extensions>
<extension class="Nexus\PHPUnit\Extension\Tachycardia">
<arguments>
<array>
<element key="timeLimit">
<double>0.75</double>
</element>
<element key="reportable">
<integer>30</integer>
</element>
<element key="precision">
<integer>2</integer>
</element>
<element key="collectBare">
<boolean>true</boolean>
</element>
<element key="tabulate">
<boolean>true</boolean>
</element>
</array>
</arguments>
</extension>
</extensions>

<logging>
<testdoxHtml outputFile="build/phpunit/testdox.html"/>
<testdoxText outputFile="build/phpunit/testdox.txt"/>
Expand All @@ -59,6 +89,7 @@
<env name="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>

<!-- Database configuration -->
<env name="database.tests.strictOn" value="true"/>
<!-- Uncomment to use alternate testing database configuration
<env name="database.tests.hostname" value="localhost"/>
<env name="database.tests.database" value="tests"/>
Expand Down
3 changes: 3 additions & 0 deletions roave-bc-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
ignoreErrors:
- '#\[BC\] SKIPPED: .+ could not be found in the located source#'

0 comments on commit 918bd85

Please sign in to comment.