Skip to content

Commit 00fdfa1

Browse files
committed
Update dev toolkit
1 parent c066ccd commit 00fdfa1

File tree

7 files changed

+90
-10
lines changed

7 files changed

+90
-10
lines changed

.github/workflows/analyze.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
with:
4040
php-version: ${{ matrix.php-versions }}
4141
tools: composer, pecl, phpunit
42-
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
42+
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
43+
env:
44+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4345

4446
- name: Get composer cache directory
4547
id: composer-cache
@@ -65,7 +67,12 @@ jobs:
6567
key: ${{ runner.os }}-phpstan-${{ github.sha }}
6668
restore-keys: ${{ runner.os }}-phpstan-
6769

68-
- name: Install dependencies
70+
- name: Install dependencies (limited)
71+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
72+
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
73+
74+
- name: Install dependencies (authenticated)
75+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
6976
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
7077
env:
7178
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

.github/workflows/compare.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# When a PR is opened or a push is made, compare
2+
# code for backwards compatibility.
3+
name: RoaveBC
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- develop
9+
paths:
10+
- 'src/**'
11+
12+
jobs:
13+
compare:
14+
name: Compare for Backwards Compatibility
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Run comparison (limited)
22+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
23+
uses: docker://nyholm/roave-bc-check-ga
24+
25+
- name: Run comparison (authenticated)
26+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
27+
uses: docker://nyholm/roave-bc-check-ga
28+
env:
29+
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

.github/workflows/test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ jobs:
2929
with:
3030
php-version: ${{ matrix.php-versions }}
3131
tools: composer, pecl, phpunit
32-
extensions: intl, json, mbstring, mysqlnd, xdebug, xml, sqlite3
32+
extensions: intl, json, mbstring, gd, mysqlnd, xdebug, xml, sqlite3
3333
coverage: xdebug
34+
env:
35+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3436

3537
- name: Get composer cache directory
3638
id: composer-cache
@@ -43,11 +45,19 @@ jobs:
4345
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
4446
restore-keys: ${{ runner.os }}-composer-
4547

46-
- name: Install dependencies
48+
- name: Install dependencies (limited)
49+
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
50+
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
51+
52+
- name: Install dependencies (authenticated)
53+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
4754
run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
4855
env:
4956
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
5057

58+
- name: Enable Tachycardia
59+
run: echo "TACHYCARDIA_MONITOR_GA=enabled" >> $GITHUB_ENV
60+
5161
- name: Test with PHPUnit
5262
run: vendor/bin/phpunit --verbose --coverage-text
5363
env:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"require-dev": {
3131
"codeigniter4/codeigniter4": "dev-develop",
3232
"myth/auth": "dev-develop",
33-
"tatter/tools": "^1.6"
33+
"tatter/tools": "^1.8"
3434
},
3535
"autoload": {
3636
"psr-4": {
@@ -55,7 +55,7 @@
5555
"prefer-stable": true,
5656
"scripts": {
5757
"analyze": "phpstan analyze",
58-
"mutate": "infection --threads=2 --coverage=build/phpunit",
58+
"mutate": "infection --threads=2 --skip-initial-tests --coverage=build/phpunit",
5959
"style": "phpcbf --standard=./vendor/codeigniter4/codeigniter4-standard/CodeIgniter4 tests/ src/",
6060
"test": "phpunit"
6161
}

phpstan.neon.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ parameters:
1010
- src/Config/Routes.php
1111
- src/Views/*
1212
ignoreErrors:
13-
- '#Call to an undefined static method Config\\Services::[A-Za-z]+\(\)#'
14-
- '#Cannot access property [\$a-z_]+ on (array|object)#'
13+
- '#Call to an undefined method CodeIgniter\\Database\\BaseBuilder::first\(\)#'
1514
- '#Unsafe usage of new static\(\)*#'
1615
universalObjectCratesClasses:
1716
- CodeIgniter\Entity
17+
- CodeIgniter\Entity\Entity
1818
- Faker\Generator
1919
scanDirectories:
2020
- vendor/codeigniter4/codeigniter4/system/Helpers

phpunit.xml.dist

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
34
bootstrap="vendor/codeigniter4/codeigniter4/system/Test/bootstrap.php"
45
backupGlobals="false"
6+
beStrictAboutCoversAnnotation="true"
7+
beStrictAboutOutputDuringTests="true"
8+
beStrictAboutTodoAnnotatedTests="true"
59
colors="true"
610
convertErrorsToExceptions="true"
711
convertNoticesToExceptions="true"
812
convertWarningsToExceptions="true"
913
executionOrder="random"
10-
stopOnError="false"
14+
failOnRisky="true"
15+
failOnWarning="true"
16+
stopOnError="true"
1117
stopOnFailure="false"
1218
stopOnIncomplete="false"
1319
stopOnSkipped="false"
14-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
20+
verbose="true">
1521

1622
<coverage includeUncoveredFiles="true" processUncoveredFiles="true">
1723
<include>
@@ -36,6 +42,30 @@
3642
</testsuite>
3743
</testsuites>
3844

45+
<extensions>
46+
<extension class="Nexus\PHPUnit\Extension\Tachycardia">
47+
<arguments>
48+
<array>
49+
<element key="timeLimit">
50+
<double>0.50</double>
51+
</element>
52+
<element key="reportable">
53+
<integer>30</integer>
54+
</element>
55+
<element key="precision">
56+
<integer>2</integer>
57+
</element>
58+
<element key="collectBare">
59+
<boolean>true</boolean>
60+
</element>
61+
<element key="tabulate">
62+
<boolean>true</boolean>
63+
</element>
64+
</array>
65+
</arguments>
66+
</extension>
67+
</extensions>
68+
3969
<logging>
4070
<testdoxHtml outputFile="build/phpunit/testdox.html"/>
4171
<testdoxText outputFile="build/phpunit/testdox.txt"/>
@@ -59,6 +89,7 @@
5989
<env name="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
6090

6191
<!-- Database configuration -->
92+
<env name="database.tests.strictOn" value="true"/>
6293
<!-- Uncomment to use alternate testing database configuration
6394
<env name="database.tests.hostname" value="localhost"/>
6495
<env name="database.tests.database" value="tests"/>

roave-bc-check.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
parameters:
2+
ignoreErrors:
3+
- '#\[BC\] SKIPPED: .+ could not be found in the located source#'

0 commit comments

Comments
 (0)