Skip to content

Commit b0ebec4

Browse files
authored
Merge pull request #3 from niden-code/master
Fix PHP re2c scanner state machine translation bugs
2 parents 715829c + 7d6939a commit b0ebec4

File tree

15 files changed

+463
-385
lines changed

15 files changed

+463
-385
lines changed

.github/workflows/main.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: "PHQL CI"
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *' # Daily at 02:00 runs only on default branch
6+
push:
7+
paths-ignore:
8+
- '**.md'
9+
- '**.txt'
10+
pull_request:
11+
workflow_dispatch:
12+
13+
permissions: {}
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
18+
19+
jobs:
20+
tests:
21+
name: PHP ${{ matrix.php }}
22+
runs-on: ubuntu-latest
23+
24+
permissions:
25+
contents: read
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
php:
31+
- '8.1'
32+
- '8.2'
33+
- '8.3'
34+
- '8.4'
35+
- '8.5'
36+
37+
steps:
38+
- uses: actions/checkout@v6
39+
40+
- name: Setup PHP
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.php }}
44+
extensions: mbstring
45+
coverage: none
46+
tools: composer:v2
47+
env:
48+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Validate composer.json
51+
run: composer validate --no-check-all --no-check-publish
52+
53+
- name: Install dependencies
54+
uses: ramsey/composer-install@v3
55+
with:
56+
composer-options: "--prefer-dist"
57+
58+
- name: Run tests
59+
run: composer test
60+
61+
coverage:
62+
name: Code Coverage
63+
runs-on: ubuntu-latest
64+
65+
permissions:
66+
contents: read
67+
68+
steps:
69+
- uses: actions/checkout@v6
70+
71+
- name: Setup PHP
72+
uses: shivammathur/setup-php@v2
73+
with:
74+
php-version: '8.3'
75+
extensions: mbstring
76+
coverage: xdebug
77+
tools: composer:v2
78+
env:
79+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
81+
- name: Install dependencies
82+
uses: ramsey/composer-install@v3
83+
with:
84+
composer-options: "--prefer-dist"
85+
86+
- name: Run tests with coverage
87+
run: vendor/bin/phpunit --coverage-clover coverage.xml
88+
89+
- name: Upload coverage to Codecov
90+
uses: codecov/codecov-action@v5
91+
with:
92+
file: ./coverage.xml
93+
fail_ci_if_error: false

.github/workflows/tests.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ composer.phar
66
phql.log
77

88
# PHPUnit
9-
.phpunit.cache/
9+
.phpunit.result.cache/
1010
coverage/
1111
coverage.xml

composer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
"php": ">=8.1",
1313
"ext-mbstring": "*"
1414
},
15+
"suggest": {
16+
"phalcon/phalcon": "The Phalcon framework this module integrates with"
17+
},
1518
"require-dev": {
19+
"phpstan/phpstan": "^2.0",
1620
"phpunit/phpunit": "^10.5"
1721
},
1822
"autoload": {
@@ -25,11 +29,12 @@
2529
},
2630
"autoload-dev": {
2731
"psr-4": {
28-
"Phalcon\\Phql\\Tests\\": "tests/"
32+
"Phalcon\\Phql\\Tests\\": "tests/",
33+
"Phalcon\\Phql\\Tests\\Unit\\": "tests/unit/"
2934
}
3035
},
3136
"scripts": {
32-
"test": "phpunit",
33-
"test:coverage": "phpunit --coverage-html coverage"
37+
"test": "vendor/bin/phpunit -c phpunit.xml --fail-on-all-issues",
38+
"test-coverage": "vendor/bin/phpunit -c phpunit.xml --coverage-html tests/_output/coverage/"
3439
}
3540
}

0 commit comments

Comments
 (0)