@@ -2,24 +2,34 @@ name: CI
2
2
3
3
on :
4
4
pull_request :
5
- branches : [ "main" ]
6
- paths-ignore :
7
- - ' .github/**'
8
- - ' **/*.md'
9
- push :
10
- branches : [ "main" ]
11
- paths-ignore :
12
- - ' .github/**'
13
- - ' **/*.md'
5
+ branches :
6
+ - main
14
7
15
8
permissions :
16
9
contents : read
17
10
18
11
jobs :
19
- tests :
20
- name : " PHP ${{ matrix.php }} + Doctrine ORM ${{ matrix.doctrine-orm }} + Doctrine Lexer ${{ matrix.doctrine-lexer }}"
12
+ should-run :
21
13
runs-on : ubuntu-latest
14
+ outputs :
15
+ run : ${{ steps.check.outputs.run }}
16
+ steps :
17
+ - name : Skip for release-please
18
+ id : check
19
+ run : |
20
+ if [ "${{ github.event.pull_request.user.id }}" = "41898282" ]; then
21
+ echo "run=false" >> $GITHUB_OUTPUT
22
+ echo "::notice::Skipping CI checks - release-please PR"
23
+ else
24
+ echo "run=true" >> $GITHUB_OUTPUT
25
+ echo "::notice::CI checks will execute - the PR author is not the release-please bot"
26
+ fi
22
27
28
+ tests :
29
+ needs : should-run
30
+ if : needs.should-run.outputs.run == 'true'
31
+ runs-on : ubuntu-latest
32
+ name : " PHP ${{ matrix.php }} + Doctrine ORM ${{ matrix.doctrine-orm }} + Doctrine Lexer ${{ matrix.doctrine-lexer }}"
23
33
strategy :
24
34
fail-fast : false
25
35
matrix :
@@ -41,70 +51,70 @@ jobs:
41
51
doctrine-lexer : ' 2.1'
42
52
43
53
steps :
44
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
54
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
45
55
46
- - name : Set up PHP with PECL extension
47
- uses : shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
48
- with :
49
- php-version : ${{ matrix.php }}
50
- coverage : xdebug
51
- extensions : ctype, json, mbstring
52
- tools : composer
56
+ - name : Set up PHP with PECL extension
57
+ uses : shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
58
+ with :
59
+ php-version : ${{ matrix.php }}
60
+ coverage : xdebug
61
+ extensions : ctype, json, mbstring
62
+ tools : composer
53
63
54
- - name : Validate composer.json and composer.lock
55
- run : composer validate --strict
64
+ - name : Validate composer.json and composer.lock
65
+ run : composer validate --strict
56
66
57
- - name : Cache Composer packages
58
- id : composer-cache
59
- uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
60
- with :
61
- path : vendor
62
- key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
63
- restore-keys : |
64
- ${{ runner.os }}-php-
67
+ - name : Cache Composer packages
68
+ id : composer-cache
69
+ uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
70
+ with :
71
+ path : vendor
72
+ key : ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
73
+ restore-keys : |
74
+ ${{ runner.os }}-php-
65
75
66
- - name : Install Doctrine Lexer dependency
67
- run : |
68
- if [ "${{ matrix.doctrine-lexer }}" = = "1.2" ]; then
69
- composer require doctrine/lexer "~1.2" --dev --prefer-dist --no-interaction --no-progress
70
- elif [ "${{ matrix.doctrine-lexer }}" = = "2.1" ]; then
71
- composer require doctrine/lexer "~2.1" --dev --prefer-dist --no-interaction --no-progress
72
- elif [ "${{ matrix.doctrine-lexer }}" = = "3.0" ]; then
73
- composer require doctrine/lexer "~3.0" --dev --prefer-dist --no-interaction --no-progress
74
- else
75
- composer update --prefer-dist --no-interaction --no-progress
76
- fi
76
+ - name : Install Doctrine Lexer dependency
77
+ run : |
78
+ if [ "${{ matrix.doctrine-lexer }}" = "1.2" ]; then
79
+ composer require doctrine/lexer "~1.2" --dev --prefer-dist --no-interaction --no-progress
80
+ elif [ "${{ matrix.doctrine-lexer }}" = "2.1" ]; then
81
+ composer require doctrine/lexer "~2.1" --dev --prefer-dist --no-interaction --no-progress
82
+ elif [ "${{ matrix.doctrine-lexer }}" = "3.0" ]; then
83
+ composer require doctrine/lexer "~3.0" --dev --prefer-dist --no-interaction --no-progress
84
+ else
85
+ composer update --prefer-dist --no-interaction --no-progress
86
+ fi
77
87
78
- - name : Install Doctrine ORM dependency
79
- run : |
80
- if [ "${{ matrix.doctrine-orm }}" = = "2.14" ]; then
81
- composer require doctrine/orm "~2.14" --prefer-dist --no-interaction --no-progress --with-all-dependencies
82
- elif [ "${{ matrix.doctrine-orm }}" = = "2.18" ]; then
83
- composer require doctrine/orm "~2.18" --prefer-dist --no-interaction --no-progress --with-all-dependencies
84
- elif [ "${{ matrix.doctrine-orm }}" = = "3.0" ]; then
85
- composer require doctrine/orm "~3.0" --prefer-dist --no-interaction --no-progress --with-all-dependencies
86
- else
87
- composer update --prefer-dist --no-interaction --no-progress
88
- fi
88
+ - name : Install Doctrine ORM dependency
89
+ run : |
90
+ if [ "${{ matrix.doctrine-orm }}" = "2.14" ]; then
91
+ composer require doctrine/orm "~2.14" --prefer-dist --no-interaction --no-progress --with-all-dependencies
92
+ elif [ "${{ matrix.doctrine-orm }}" = "2.18" ]; then
93
+ composer require doctrine/orm "~2.18" --prefer-dist --no-interaction --no-progress --with-all-dependencies
94
+ elif [ "${{ matrix.doctrine-orm }}" = "3.0" ]; then
95
+ composer require doctrine/orm "~3.0" --prefer-dist --no-interaction --no-progress --with-all-dependencies
96
+ else
97
+ composer update --prefer-dist --no-interaction --no-progress
98
+ fi
89
99
90
- - name : Run static analysis
91
- run : composer run-static-analysis
92
- continue-on-error : ${{ matrix.continue-on-error || false }}
100
+ - name : Run static analysis
101
+ run : composer run-static-analysis
102
+ continue-on-error : ${{ matrix.continue-on-error || false }}
93
103
94
- - name : Check code style
95
- run : composer check-code-style
104
+ - name : Check code style
105
+ run : composer check-code-style
96
106
97
- - name : Check for security vulnerabilities in 3rd party dependencies
98
- run : composer audit
107
+ - name : Check for security vulnerabilities in 3rd party dependencies
108
+ run : composer audit
99
109
100
- - name : Run test suite
101
- run : composer run-tests-with-clover
110
+ - name : Run test suite
111
+ run : composer run-tests-with-clover
102
112
103
- - name : Upload coverage results to Coveralls
104
- if : matrix.calculate-code-coverage == true
105
- uses : coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
106
- with :
107
- github-token : ${{ secrets.GITHUB_TOKEN }}
108
- fail-on-error : false
109
- base-path : ./var/logs/test-coverage/
110
- flag-name : " PHP ${{ matrix.php }}"
113
+ - name : Upload coverage results to Coveralls
114
+ if : matrix.calculate-code-coverage == true
115
+ uses : coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2
116
+ with :
117
+ github-token : ${{ secrets.GITHUB_TOKEN }}
118
+ fail-on-error : false
119
+ base-path : ./var/logs/test-coverage/
120
+ flag-name : " PHP ${{ matrix.php }}"
0 commit comments