Skip to content

Commit c6ad248

Browse files
committed
Merge branch '5.11.x'
Signed-off-by: Maurício Meneghini Fauth <[email protected]>
2 parents 9ce6253 + 707e336 commit c6ad248

File tree

4 files changed

+157
-188
lines changed

4 files changed

+157
-188
lines changed
Lines changed: 48 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,54 @@
1-
name: Lint and analyse php files
1+
name: Lint and analyse PHP files
22

33
on:
44
push:
55
pull_request:
6-
types: [opened, synchronize, reopened]
6+
types: [ opened, synchronize, reopened ]
77

88
jobs:
9-
lint-php:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: Use PHP 8.2
14-
uses: shivammathur/setup-php@v2
15-
with:
16-
php-version: 8.2
17-
- name: Validate composer.json and composer.lock
18-
run: composer validate
19-
- name: Cache module
20-
uses: actions/cache@v3
21-
with:
22-
path: ~/.composer/cache/
23-
key: composer-cache
24-
- name: Install dependencies
25-
run: composer install
26-
- name: Lint files
27-
run: composer run phpcs
28-
29-
analyse-php:
30-
runs-on: ubuntu-latest
31-
strategy:
32-
matrix:
33-
php-version: ["8.2"]
34-
steps:
35-
- uses: actions/checkout@v3
36-
- name: Use PHP ${{ matrix.php-version }}
37-
uses: shivammathur/setup-php@v2
38-
with:
39-
php-version: ${{ matrix.php-version }}
40-
tools: composer:v2
41-
42-
- name: Get Composer cache directory
43-
id: composer-cache
44-
run: |
45-
echo "::set-output name=dir::$(composer config cache-files-dir)"
46-
47-
- name: Cache dependencies
48-
uses: actions/cache@v3
49-
with:
50-
path: ${{ steps.composer-cache.outputs.dir }}
51-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
52-
restore-keys: |
53-
composer-${{ runner.os }}-${{ matrix.php-version }}-
54-
55-
- name: Install dependencies
56-
run: composer install
57-
- name: Analyse files with PHPStan
58-
run: composer run phpstan
59-
- name: Analyse files with Psalm
60-
# Allow the previous check to fail but not abort
61-
if: always()
62-
run: composer run psalm -- --shepherd
9+
lint-php:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php-version: [ '8.2' ]
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up PHP ${{ matrix.php-version }}
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-version }}
22+
23+
- name: Install Composer dependencies
24+
uses: ramsey/composer-install@v3
25+
26+
- name: Check coding-standard
27+
run: composer run phpcs
28+
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate --strict
31+
32+
analyse-php:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
php-version: [ '8.2' ]
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Set up PHP ${{ matrix.php-version }}
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: ${{ matrix.php-version }}
45+
46+
- name: Install Composer dependencies
47+
uses: ramsey/composer-install@v3
48+
49+
- name: Analyse files with PHPStan
50+
run: composer run phpstan
51+
52+
- name: Analyse files with Psalm
53+
if: always()
54+
run: composer run psalm -- --shepherd

.github/workflows/lint-docs.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
name: lint php documentation
1+
name: Lint PHP documentation
22

33
on:
44
push:
55
pull_request:
6-
types: [opened, synchronize, reopened]
6+
types: [ opened, synchronize, reopened ]
77

88
jobs:
9-
lint-docs:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- name: lint php documentation
14-
uses: sudo-bot/action-doctum@v5
15-
with:
16-
config-file: tools/doctum-config.php
17-
method: "parse"
18-
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors"
9+
lint-docs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: lint php documentation
16+
uses: sudo-bot/action-doctum@v5
17+
with:
18+
config-file: tools/doctum-config.php
19+
method: "parse"
20+
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors"

.github/workflows/mutation-tests.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,30 @@ on:
1313
jobs:
1414
tests:
1515
name: Mutation tests with PHP ${{ matrix.php-version }}
16-
1716
runs-on: ${{ matrix.operating-system }}
18-
1917
strategy:
2018
matrix:
21-
php-version: ["8.2"]
22-
operating-system: [ubuntu-latest]
23-
19+
php-version: [ '8.2' ]
20+
operating-system: [ ubuntu-latest ]
2421
steps:
25-
- name: Checkout
26-
uses: actions/checkout@v3
22+
- name: Checkout code
23+
uses: actions/checkout@v4
2724

2825
- name: Fetch github.base_ref (for diffing)
2926
if: ${{ github.base_ref != '' }}
3027
run: |
3128
git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
3229
33-
- name: Install PHP ${{ matrix.php-version }}
30+
- name: Set up PHP ${{ matrix.php-version }}
3431
uses: shivammathur/setup-php@v2
3532
with:
3633
php-version: ${{ matrix.php-version }}
3734
coverage: pcov
3835
ini-values: memory_limit=-1
39-
tools: composer:v2, infection:0.27.11
40-
41-
- name: Get Composer cache directory
42-
id: composer-cache
43-
run: |
44-
echo "::set-output name=dir::$(composer config cache-files-dir)"
45-
46-
- name: Cache dependencies
47-
uses: actions/cache@v3
48-
with:
49-
path: ${{ steps.composer-cache.outputs.dir }}
50-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
51-
restore-keys: |
52-
composer-${{ runner.os }}-${{ matrix.php-version }}-
36+
tools: infection
5337

54-
- name: Install dependencies
55-
run: |
56-
composer update --no-interaction --no-progress
38+
- name: Install Composer dependencies
39+
uses: ramsey/composer-install@v3
5740

5841
- name: Collect coverage report
5942
run: composer run phpunit -- --stop-on-failure

.github/workflows/tests.yml

Lines changed: 87 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3,101 +3,93 @@ name: Run tests
33
on:
44
push:
55
pull_request:
6-
types: [opened, synchronize, reopened]
6+
types: [ opened, synchronize, reopened ]
77

88
jobs:
9-
test-php:
10-
name: Test on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
11-
runs-on: ${{ matrix.os }}
12-
continue-on-error: ${{ matrix.experimental }}
13-
strategy:
14-
matrix:
15-
php-version: ["8.2", "8.3"]
16-
os: [ubuntu-latest]
17-
experimental: [false]
18-
composer-options: ['']
19-
include:
20-
- { php-version: 'nightly', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
21-
steps:
22-
- uses: actions/checkout@v3
23-
with:
24-
# Fetch some commits for Scrutinizer coverage upload
25-
fetch-depth: 15
26-
- name: Use PHP ${{ matrix.php-version }}
27-
uses: shivammathur/setup-php@v2
28-
with:
29-
php-version: ${{ matrix.php-version }}
30-
# phar, json and curl are used by composer
31-
# json is used by testing code
32-
# dom, json, mbstring, libxml, xml, xmlwriter are used by phpunit
33-
# tokenizer, xmlwriter and simplexml are used by phpcs
34-
# ctype is used by Psalm
35-
extensions: none, mbstring, phar, json, curl, tokenizer, xml, xmlwriter, simplexml, libxml, dom, ctype
36-
coverage: xdebug
37-
- name: Get Composer Cache Directory
38-
id: composer-cache
39-
run: |
40-
echo "::set-output name=dir::$(composer config cache-files-dir)"
41-
- name: Restore cache
42-
uses: actions/cache@v3
43-
with:
44-
path: ${{ steps.composer-cache.outputs.dir }}
45-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-composer-
48-
- name: Install dependencies
49-
run: composer install --no-interaction ${{ matrix.composer-options }}
50-
- name: Run php tests
51-
run: composer run phpunit
52-
- name: Send coverage
53-
uses: codecov/codecov-action@v3
54-
- name: Send coverage to Scrutinizer
55-
uses: sudo-bot/action-scrutinizer@latest
56-
# Do not run this step on forked versions of the main repository (example: contributor forks)
57-
if: github.repository == 'phpmyadmin/sql-parser'
58-
with:
59-
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
9+
test-php:
10+
name: Test on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
continue-on-error: ${{ matrix.experimental }}
13+
strategy:
14+
matrix:
15+
php-version: [ '8.2', '8.3', '8.4' ]
16+
os: [ ubuntu-latest ]
17+
experimental: [ false ]
18+
composer-options: [ '' ]
19+
include:
20+
- { php-version: '8.5', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-req=php+' }
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
# Fetch some commits for Scrutinizer coverage upload
26+
fetch-depth: 15
6027

61-
php-benchmark:
62-
name: Benchmark on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
63-
runs-on: ${{ matrix.os }}
64-
continue-on-error: ${{ matrix.experimental }}
65-
strategy:
66-
matrix:
67-
php-version: ["8.2", "8.3"]
68-
os: [ubuntu-latest]
69-
experimental: [false]
70-
composer-options: ['']
71-
include:
72-
- { php-version: 'nightly', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
73-
steps:
74-
- uses: actions/checkout@v3
75-
with:
76-
# Fetch some commits for Scrutinizer coverage upload
77-
fetch-depth: 15
78-
- name: Use PHP ${{ matrix.php-version }}
79-
uses: shivammathur/setup-php@v2
80-
with:
81-
php-version: ${{ matrix.php-version }}
82-
# phar, json and curl are used by composer
83-
# json is used by testing code
84-
# dom, json, mbstring, libxml, xml, xmlwriter are used by phpunit
85-
# tokenizer, xmlwriter and simplexml are used by phpcs
86-
# ctype is used by Psalm
87-
extensions: none, mbstring, phar, json, curl, tokenizer, xml, xmlwriter, simplexml, libxml, dom, ctype
88-
coverage: xdebug
89-
- name: Get Composer Cache Directory
90-
id: composer-cache
91-
run: |
92-
echo "::set-output name=dir::$(composer config cache-files-dir)"
93-
- name: Restore cache
94-
uses: actions/cache@v3
95-
with:
96-
path: ${{ steps.composer-cache.outputs.dir }}
97-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
98-
restore-keys: |
99-
${{ runner.os }}-composer-
100-
- name: Install dependencies
101-
run: composer install --no-interaction ${{ matrix.composer-options }}
102-
- name: Run benchmarks
103-
run: composer run phpbench
28+
- name: Set up PHP ${{ matrix.php-version }}
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
# phar, json and curl are used by composer
33+
# json is used by testing code
34+
# dom, json, mbstring, libxml, xml, xmlwriter are used by phpunit
35+
# tokenizer, xmlwriter and simplexml are used by phpcs
36+
# ctype is used by Psalm
37+
extensions: none, mbstring, phar, json, curl, tokenizer, xml, xmlwriter, simplexml, libxml, dom, ctype
38+
coverage: xdebug
39+
40+
- name: Install Composer dependencies
41+
uses: ramsey/composer-install@v3
42+
with:
43+
composer-options: ${{ matrix.composer-options }}
44+
45+
- name: Run PHP tests
46+
run: composer run phpunit
47+
48+
- name: Send coverage
49+
uses: codecov/codecov-action@v3
50+
51+
- name: Send coverage to Scrutinizer
52+
uses: sudo-bot/action-scrutinizer@latest
53+
# Do not run this step on forked versions of the main repository (example: contributor forks)
54+
if: github.repository == 'phpmyadmin/sql-parser'
55+
with:
56+
cli-args: "--format=php-clover build/logs/clover.xml --revision=${{ github.event.pull_request.head.sha || github.sha }}"
57+
58+
php-benchmark:
59+
name: Benchmark on PHP ${{ matrix.php-version }} and ${{ matrix.os }}
60+
runs-on: ${{ matrix.os }}
61+
continue-on-error: ${{ matrix.experimental }}
62+
strategy:
63+
matrix:
64+
php-version: [ '8.2', '8.3', '8.4' ]
65+
os: [ ubuntu-latest ]
66+
experimental: [ false ]
67+
composer-options: [ '' ]
68+
include:
69+
- { php-version: '8.5', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-req=php+' }
70+
steps:
71+
- name: Checkout code
72+
uses: actions/checkout@v4
73+
with:
74+
# Fetch some commits for Scrutinizer coverage upload
75+
fetch-depth: 15
76+
77+
- name: Set up PHP ${{ matrix.php-version }}
78+
uses: shivammathur/setup-php@v2
79+
with:
80+
php-version: ${{ matrix.php-version }}
81+
# phar, json and curl are used by composer
82+
# json is used by testing code
83+
# dom, json, mbstring, libxml, xml, xmlwriter are used by phpunit
84+
# tokenizer, xmlwriter and simplexml are used by phpcs
85+
# ctype is used by Psalm
86+
extensions: none, mbstring, phar, json, curl, tokenizer, xml, xmlwriter, simplexml, libxml, dom, ctype
87+
coverage: xdebug
88+
89+
- name: Install Composer dependencies
90+
uses: ramsey/composer-install@v3
91+
with:
92+
composer-options: ${{ matrix.composer-options }}
93+
94+
- name: Run benchmarks
95+
run: composer run phpbench

0 commit comments

Comments
 (0)