@@ -59,49 +59,137 @@ jobs:
59
59
--health-timeout 5s
60
60
--health-retries 5
61
61
steps :
62
- - uses : actions/checkout@v4
62
+ - name : Checkout code
63
+ uses : actions/checkout@v4
64
+
63
65
- name : Validate composer.json
64
66
run : composer validate --strict
65
- - name : Get Composer Cache Directory
67
+
68
+ - name : Display Composer Cache Directory
66
69
id : composer-cache
67
70
run : |
68
71
echo "::set-output name=dir::$(composer config cache-files-dir)"
69
- - uses : actions/cache@v4
72
+
73
+ - name : Restore cache Composer dependencies
74
+ uses : actions/cache@v4
70
75
with :
71
76
path : ${{ steps.composer-cache.outputs.dir }}
72
77
key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
73
78
restore-keys : |
74
79
${{ runner.os }}-composer-
80
+
75
81
- name : Setup PHP ${{ matrix.php }}
76
82
uses : shivammathur/setup-php@v2
77
83
with :
78
84
php-version : ${{ matrix.php }}
79
85
coverage : pcov
80
86
tools : composer:v2
87
+
81
88
- name : Echo PHP version
82
89
run : php -v
83
- - name : Copy testsuites
90
+
91
+ - name : Copy test suites
84
92
run : cp .github/phpunit.*.xml .
93
+
85
94
- name : Install libraries
86
95
run : composer --prefer-stable update -vvv
96
+
87
97
- name : Force doctrine/orm library to ${{ matrix.orm }}
88
98
run : composer --prefer-stable require doctrine/orm:${{ matrix.orm }} --with-all-dependencies
89
- - name : Run test suite and coverage
99
+
100
+ - name : Run test suite and with coverage for codeclimate for PHP 8.3 and doctrine/orm ^3.1 only
90
101
if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' && env.HAS_CC_SECRET == 'true' }}
91
102
92
103
env :
93
104
CC_TEST_REPORTER_ID : ${{secrets.CC_TEST_REPORTER_ID}}
94
105
with :
95
106
coverageCommand : composer run-script test-coverage
96
107
coverageLocations : ${{github.workspace}}/.phpunit.cache/code-coverage/clover*.xml:clover
97
- - name : Run test suite for forks or version without coverage
108
+
109
+ - name : Run test suite for forks or version without code coverage
98
110
if : ${{ matrix.php != '8.3' || matrix.orm != '^3.1' || env.HAS_CC_SECRET != 'true' }}
99
111
run : composer run-script test
112
+
100
113
- name : Coveralls.io steps
101
114
if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' && env.HAS_CA_SECRET == 'true' }}
102
115
uses : coverallsapp/github-action@v2
103
116
with :
104
117
github-token : ${{ secrets.COVERALLS_REPO_TOKEN }}
105
118
file : ${{github.workspace}}/.phpunit.cache/code-coverage/clover.xml
106
- - name : Check quality code
107
- run : composer run-script check-quality-code
119
+
120
+ # # Quality checks
121
+ # # PHP-CS-Fixer is needed with only one version of PHP
122
+ - name : Cache Composer PHP-CS-FIXER packages
123
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
124
+ id : composer-phpcsfixer-cache
125
+ uses : actions/cache@v4
126
+ with :
127
+ path : quality/php-cs-fixer/vendor/
128
+ key : ${{ runner.os }}-phpcsfixer-${{ hashFiles('**/composer.lock') }}
129
+ restore-keys : |
130
+ ${{ runner.os }}-phpcsfixer-
131
+
132
+ - name : Install PHP-CS-Fixer
133
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
134
+ run : composer update --working-dir=quality/php-cs-fixer
135
+
136
+ - name : Run PHP-CS-Fixer
137
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
138
+ run : ./quality/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=quality/php-cs-fixer/.php-cs-fixer.php --dry-run --allow-risky=yes
139
+
140
+ # # PHP-MESS-DETECTOR
141
+ - name : Cache Composer PHP-MESS-DETECTOR packages
142
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
143
+ id : composer-phpmd-cache
144
+ uses : actions/cache@v4
145
+ with :
146
+ path : quality/php-cs-fixer/vendor/
147
+ key : ${{ runner.os }}-phpmd-${{ hashFiles('**/composer.lock') }}
148
+ restore-keys : |
149
+ ${{ runner.os }}-phpmd-
150
+ - name : Install PHP-MESS-DETECTOR
151
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
152
+ run : composer update --working-dir=quality/php-mess-detector
153
+ - name : Run PHP-MESS-DETECTOR on lib directory
154
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
155
+ run : ./quality/php-mess-detector/vendor/bin/phpmd lib text quality/php-mess-detector/ruleset.xml
156
+ - name : Run PHP-MESS-DETECTOR on tests directory
157
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
158
+ run : ./quality/php-mess-detector/vendor/bin/phpmd tests text quality/php-mess-detector/test-ruleset.xml
159
+
160
+ # # PHP CODE SNIFFER
161
+ - name : Cache Composer PHP-CS packages
162
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
163
+ id : composer-php-cs-cache
164
+ uses : actions/cache@v4
165
+ with :
166
+ path : quality/php-cs-fixer/vendor/
167
+ key : ${{ runner.os }}-php-cs-${{ hashFiles('**/composer.lock') }}
168
+ restore-keys : |
169
+ ${{ runner.os }}-php-cs-
170
+
171
+ - name : Install PHP-CS
172
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
173
+ run : composer update --working-dir=quality/php-code-sniffer
174
+
175
+ - name : Run PHP-CS
176
+ if : ${{ matrix.php == '8.3' && matrix.orm == '^3.1' }}
177
+ run : ./quality/php-code-sniffer/vendor/bin/phpcs --standard=quality/php-code-sniffer/phpcs.xml -s
178
+
179
+ # # PHP-STAN
180
+ # - name: Cache Composer PHP-STAN packages
181
+ # if: ${{ matrix.lexer-version == '~3.0.0' }}
182
+ # id: composer-php-stan-cache
183
+ # uses: actions/cache@v4
184
+ # with:
185
+ # path: quality/php-cs-fixer/vendor/
186
+ # key: ${{ runner.os }}-php-stan-${{ hashFiles('**/composer.lock') }}
187
+ # restore-keys: |
188
+ # ${{ runner.os }}-php-stan-
189
+ # - name: Install PHP-STAN
190
+ # if: ${{ matrix.lexer-version == '~3.0.0' }}
191
+ # run: composer update --working-dir=quality/php-stan
192
+ # - name: Run PHP-STAN
193
+ # if: ${{ matrix.lexer-version == '~3.0.0' }}
194
+ # run: ./quality/php-stan/vendor/bin/phpstan analyse --configuration=quality/php-stan/php-stan.neon lib tests --error-format=table --no-progress --no-interaction --no-ansi --level=9 --memory-limit=256M -v
195
+
0 commit comments