Skip to content

Commit 37625f6

Browse files
committed
:octocat: php 8.1
1 parent b9027e2 commit 37625f6

File tree

5 files changed

+44
-64
lines changed

5 files changed

+44
-64
lines changed

.github/workflows/ci.yml

+18-11
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ jobs:
1616

1717
static-code-analysis:
1818
name: "Static Code Analysis"
19-
2019
runs-on: ubuntu-latest
2120

21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
php-version:
25+
- "8.1"
26+
- "8.2"
27+
2228
env:
2329
PHAN_ALLOW_XDEBUG: 0
2430
PHAN_DISABLE_XDEBUG_WARN: 1
@@ -30,20 +36,21 @@ jobs:
3036
- name: "Install PHP"
3137
uses: shivammathur/setup-php@v2
3238
with:
33-
php-version: "7.4"
39+
php-version: ${{ matrix.php-version }}
3440
tools: pecl
3541
coverage: none
3642
extensions: ast, curl, json, simplexml, zlib
3743

3844
- name: "Update dependencies with composer"
39-
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-source
45+
uses: ramsey/composer-install@v2
4046

4147
- name: "Run phan"
42-
run: php vendor/bin/phan
48+
run: php vendor/bin/phan --target-php-version=${{ matrix.php-version }}
49+
4350

4451
build-docs:
4552
name: "Build and publish Docs"
46-
53+
if: github.ref_name == 'main'
4754
runs-on: ubuntu-latest
4855

4956
steps:
@@ -62,15 +69,16 @@ jobs:
6269
run: phpdoc --config=phpdoc.xml
6370

6471
- name: "Publish Docs to gh-pages"
65-
uses: JamesIves/github-pages-deploy-action@v4.3.4
72+
uses: JamesIves/github-pages-deploy-action@v4
6673
with:
6774
BRANCH: gh-pages
6875
FOLDER: docs
6976
CLEAN: true
7077

78+
7179
tests:
7280
name: "Unit Tests"
73-
81+
needs: static-code-analysis
7482
runs-on: ${{ matrix.os }}
7583

7684
strategy:
@@ -80,9 +88,8 @@ jobs:
8088
- ubuntu-latest
8189
- windows-latest
8290
php-version:
83-
- "7.4"
84-
- "8.0"
8591
- "8.1"
92+
- "8.2"
8693

8794
steps:
8895
# - name: "Configure git to avoid issues with line endings"
@@ -161,8 +168,8 @@ jobs:
161168
extensions: mbstring, odbc, pdo_odbc, mysqli, pdo_mysql, pgsql, pdo_pgsql, sqlite3, pdo_sqlite, sqlsrv, pdo_sqlsrv, pdo_firebird
162169
# ini-values:
163170

164-
- name: "Install dependencies with composer"
165-
run: composer update --no-ansi --no-interaction --no-progress --no-suggest --prefer-source
171+
- name: "Update dependencies with composer"
172+
uses: ramsey/composer-install@v2
166173

167174
- name: "Run tests with phpunit"
168175
run: php vendor/phpunit/phpunit/phpunit --configuration=phpunit.xml.dist

.phan/config.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
// Note that the **only** effect of choosing `'5.6'` is to infer
1515
// that functions removed in php 7.0 exist.
1616
// (See `backward_compatibility_checks` for additional options)
17-
'target_php_version' => '7.4',
17+
'target_php_version' => null,
18+
'minimum_target_php_version' => '8.1',
1819

1920
// A list of directories that should be parsed for class and
2021
// method information. After excluding the directories

composer.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"homepage": "https://github.com/chillerlan/php-database",
55
"license": "MIT",
66
"type": "library",
7-
"minimum-stability": "stable",
7+
"minimum-stability": "dev",
8+
"prefer-stable": true,
89
"keywords": [
910
"database", "query", "builder", "querybuilder", "driver", "mysql",
1011
"postgres", "mariadb", "firebird", "sqlite", "mssql"
@@ -21,19 +22,19 @@
2122
"source": "https://github.com/chillerlan/php-database"
2223
},
2324
"require": {
24-
"php": "^7.4 || ^8.0",
25+
"php": "^8.1",
2526
"ext-json": "*",
2627
"ext-mbstring": "*",
27-
"chillerlan/php-settings-container": "^2.1.4",
28+
"chillerlan/php-settings-container": "^3.0",
2829
"psr/simple-cache": "^1.0",
2930
"psr/log": "^1.1 || ^2.0 || ^3.0"
3031
},
3132
"require-dev": {
3233
"chillerlan/php-dotenv": "^2.1.2",
33-
"chillerlan/php-cache": "^4.1",
34-
"monolog/monolog": "^2.3",
35-
"phan/phan": "^5.3",
36-
"phpunit/phpunit": "^9.5"
34+
"chillerlan/php-cache": "dev-main#fca6963aefb689b333c511e3807809b9f88e0c0d",
35+
"monolog/monolog": "^3.3",
36+
"phan/phan": "^5.4",
37+
"phpunit/phpunit": "^10.0"
3738
},
3839
"autoload": {
3940
"psr-4": {

phpunit.xml

-34
This file was deleted.

phpunit.xml.dist

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
<?xml version="1.0"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
cacheResultFile=".build/phpunit.result.cache"
66
colors="true"
7-
verbose="true"
87
>
9-
<coverage>
10-
<include>
11-
<directory suffix=".php">./src</directory>
12-
</include>
13-
<report>
14-
<clover outputFile=".build/coverage/clover.xml"/>
15-
<xml outputDirectory=".build/coverage/coverage-xml"/>
16-
</report>
17-
</coverage>
188
<testsuites>
199
<testsuite name="php-database test suite">
2010
<directory suffix=".php">./tests</directory>
11+
<!-- abstract classes because phpunit 10 -.- -->
12+
<exclude>./tests/DBTestAbstract.php</exclude>
13+
<exclude>./tests/Drivers/DriverTestAbstract.php</exclude>
14+
<exclude>./tests/Drivers/PDODriverTestAbstract.php</exclude>
15+
<exclude>./tests/Query/QueryTestAbstract.php</exclude>
16+
<!-- excluded tests on CI -->
2117
<exclude>./tests/Drivers/PDOFirebirdTest.php</exclude>
2218
<exclude>./tests/Drivers/MSSqlSrvTest.php</exclude>
2319
<exclude>./tests/Drivers/PDOMSSqlSrvTest.php</exclude>
@@ -31,6 +27,15 @@
3127
<exclude>./tests/Query/PostgresTest.php</exclude>
3228
</testsuite>
3329
</testsuites>
30+
<coverage>
31+
<include>
32+
<directory suffix=".php">./src</directory>
33+
</include>
34+
<report>
35+
<clover outputFile=".build/coverage/clover.xml"/>
36+
<xml outputDirectory=".build/coverage/coverage-xml"/>
37+
</report>
38+
</coverage>
3439
<logging>
3540
<junit outputFile=".build/logs/junit.xml"/>
3641
</logging>

0 commit comments

Comments
 (0)