@@ -3,101 +3,93 @@ name: Run tests
3
3
on :
4
4
push :
5
5
pull_request :
6
- types : [opened, synchronize, reopened]
6
+ types : [ opened, synchronize, reopened ]
7
7
8
8
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
60
27
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