Skip to content

Commit 9651fd0

Browse files
authored
Implement SQLBuilder (#381)
* tidy: refactor before work on #191 * tidy: refactor before work on #191 * ci: upgrade workflow * build: php8.1 compatbility * feature: implement SQLSqlBuilder closes #191 * tidy: satisfy static analysis * build: php8.2 compatibility * tweak: add missing exception * docs: sqlbuilder examples
1 parent 80f515c commit 9651fd0

20 files changed

Lines changed: 1245 additions & 239 deletions

.codacy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
exclude_paths:
2+
- ".github/**"
3+
- "example/**"
4+
- "test/**"
5+

.github/workflows/ci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
pull_request:
46

57
permissions:
68
contents: read
79
actions: read
8-
id-token: none
910

1011
jobs:
1112
composer:
1213
runs-on: ubuntu-latest
1314
strategy:
1415
matrix:
15-
php: [ 8.1, 8.2, 8.3, 8.4 ]
16+
php: [ 8.2, 8.3, 8.4, 8.5 ]
1617

1718
steps:
18-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
1920

2021
- name: Cache Composer dependencies
21-
uses: actions/cache@v4
22+
uses: actions/cache@v5
2223
with:
2324
path: /tmp/composer-cache
2425
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
@@ -27,6 +28,7 @@ jobs:
2728
uses: php-actions/composer@v6
2829
with:
2930
php_version: ${{ matrix.php }}
31+
php_extensions: pcntl
3032

3133
- name: Archive build
3234
run: mkdir /tmp/github-actions/ && tar --exclude=".git" -cvf /tmp/github-actions/build.tar ./
@@ -42,7 +44,7 @@ jobs:
4244
needs: [ composer ]
4345
strategy:
4446
matrix:
45-
php: [ 8.1, 8.2, 8.3, 8.4 ]
47+
php: [ 8.2, 8.3, 8.4, 8.5 ]
4648

4749
outputs:
4850
coverage: ${{ steps.store-coverage.outputs.coverage_text }}
@@ -77,7 +79,7 @@ jobs:
7779
needs: [ phpunit ]
7880
strategy:
7981
matrix:
80-
php: [ 8.1, 8.2, 8.3, 8.4 ]
82+
php: [ 8.2, 8.3, 8.4, 8.5 ]
8183

8284
steps:
8385
- uses: actions/checkout@v4
@@ -92,13 +94,15 @@ jobs:
9294

9395
- name: Upload to Codecov
9496
uses: codecov/codecov-action@v5
97+
with:
98+
token: ${{ secrets.CODECOV_TOKEN }}
9599

96100
phpstan:
97101
runs-on: ubuntu-latest
98102
needs: [ composer ]
99103
strategy:
100104
matrix:
101-
php: [ 8.1, 8.2, 8.3, 8.4 ]
105+
php: [ 8.2, 8.3, 8.4, 8.5 ]
102106

103107
steps:
104108
- uses: actions/download-artifact@v4
@@ -114,13 +118,15 @@ jobs:
114118
with:
115119
php_version: ${{ matrix.php }}
116120
path: src/
121+
level: 6
122+
memory_limit: 256M
117123

118124
phpmd:
119125
runs-on: ubuntu-latest
120126
needs: [ composer ]
121127
strategy:
122128
matrix:
123-
php: [ 8.1, 8.2, 8.3, 8.4 ]
129+
php: [ 8.2, 8.3, 8.4, 8.5 ]
124130

125131
steps:
126132
- uses: actions/download-artifact@v4
@@ -132,7 +138,7 @@ jobs:
132138
run: tar -xvf /tmp/github-actions/build.tar ./
133139

134140
- name: PHP Mess Detector
135-
uses: php-actions/phpmd@v2
141+
uses: php-actions/phpmd@v1
136142
with:
137143
php_version: ${{ matrix.php }}
138144
path: src/
@@ -144,7 +150,7 @@ jobs:
144150
needs: [ composer ]
145151
strategy:
146152
matrix:
147-
php: [ 8.1, 8.2, 8.3, 8.4 ]
153+
php: [ 8.2, 8.3, 8.4, 8.5 ]
148154

149155
steps:
150156
- uses: actions/download-artifact@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/test/unit/_coverage/
44
/docs
55
/composer.phar
6+
/test/phpunit/.phpunit.cache
7+
/test/phpunit/_coverage

composer.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"ext-PDO": "*",
99
"phpgt/config": "^v1.1.0",
1010
"phpgt/cli": "^1.3",
11-
"greenlion/php-sql-parser": "^4.6"
11+
"greenlion/php-sql-parser": "^4.6",
12+
"phpgt/sqlbuilder": "^1.0.1"
1213
},
1314

1415
"require-dev": {
@@ -24,7 +25,7 @@
2425
"authors": [
2526
{
2627
"name": "Greg Bowler",
27-
"email": "greg.bowler@g105b.com"
28+
"email": "greg@g105b.com"
2829
},
2930
{
3031
"name": "James Fellows",
@@ -48,6 +49,20 @@
4849
}
4950
},
5051

52+
"scripts": {
53+
"phpunit": "vendor/bin/phpunit --configuration phpunit.xml",
54+
"phpunit:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --configuration phpunit.xml --coverage-text",
55+
"phpstan": "vendor/bin/phpstan analyse --level 6 src",
56+
"phpcs": "vendor/bin/phpcs src --standard=phpcs.xml",
57+
"phpmd": "vendor/bin/phpmd src/ text phpmd.xml",
58+
"test": [
59+
"@phpunit",
60+
"@phpstan",
61+
"@phpcs",
62+
"@phpmd"
63+
]
64+
},
65+
5166
"bin": [
5267
"bin/migrate"
5368
],

0 commit comments

Comments
 (0)