88 types : [ created ]
99 schedule :
1010 # Do not make it the first of the month and/or midnight since it is a very busy time
11- - cron : " * 10 5 * *"
11+ - cron : " * 10 5 * *"
1212
1313# See https://stackoverflow.com/a/72408109
1414concurrency :
@@ -149,6 +149,72 @@ jobs:
149149 - name : Run e2e ${{ matrix.e2e }}
150150 run : make ${{ matrix.e2e }} --debug
151151
152+
153+ # Most of the job definitions come from https://github.com/sebastianbergmann/phpunit/blob/main/.github/workflows/ci.yml#L228
154+ # (job name "test-phar").
155+ test-phpunit-scoping :
156+ runs-on : ubuntu-latest
157+ needs : build-test-phar
158+
159+ env :
160+ PHP_EXTENSIONS : none, curl, dom, json, fileinfo, iconv, libxml, mbstring, phar, soap, tokenizer, xml, xmlwriter
161+ PHP_INI_VALUES : assert.exception=1, phar.readonly=0, zend.assertions=1
162+
163+ strategy :
164+ fail-fast : false
165+ matrix :
166+ php-version :
167+ - ' 8.2'
168+ coverage :
169+ - xdebug
170+
171+ steps :
172+ - name : Checkout PHPUnit code
173+ uses : actions/checkout@v4
174+ with :
175+ repository : ' sebastianbergmann/phpunit'
176+
177+
178+ - name : Install PHP with extensions
179+ uses : shivammathur/setup-php@v2
180+ with :
181+ php-version : ${{ matrix.php-version }}
182+ coverage : ${{ matrix.coverage }}
183+ extensions : ${{ env.PHP_EXTENSIONS }}
184+ ini-values : ${{ env.PHP_INI_VALUES }}
185+ tools : none
186+
187+ - name : Install java
188+ uses : actions/setup-java@v3
189+ with :
190+ distribution : zulu
191+ java-version : 11
192+
193+ - name : Retrieve built PHP-Scoper PHAR
194+ uses : actions/download-artifact@v3
195+ with :
196+ name : php-scoper-phar-${{ matrix.php-version }}
197+ path : bin
198+
199+ # See https://github.com/actions/download-artifact#limitations
200+ # the permissions are not guaranteed to be preserved
201+ - name : Ensure PHAR is executable
202+ run : chmod 755 bin/php-scoper.phar
203+
204+ - name : Make the downloaded PHP-Scoper PHAR the PHPUnit scoper used
205+ run : mv -f bin/php-scoper.phar tools/php-scoper
206+
207+ - name : Check that the PHP-Scoper PHAR works
208+ run : tools/php-scoper --version
209+
210+ - name : Build PHPUnit scoped PHAR
211+ run : ant phar-snapshot
212+
213+ # To keep in sync with e2e.file#e2e_038
214+ - name : Run PHPUnit PHAR-specific tests
215+ run : ant run-phar-specific-tests
216+
217+
152218 # This is a "trick", a meta task which does not change, and we can use in
153219 # the protected branch rules as opposed to the E2E tests one above which
154220 # may change regularly.
@@ -160,12 +226,13 @@ jobs:
160226 needs :
161227 - build-test-phar
162228 - e2e-tests
229+ - test-phpunit-scoping
163230 if : always()
164231 steps :
165- - name : Successful run
166- if : ${{ !(contains(needs.*.result, 'failure')) }}
167- run : exit 0
232+ - name : Successful run
233+ if : ${{ !(contains(needs.*.result, 'failure')) }}
234+ run : exit 0
168235
169- - name : Failing run
170- if : ${{ contains(needs.*.result, 'failure') }}
171- run : exit 1
236+ - name : Failing run
237+ if : ${{ contains(needs.*.result, 'failure') }}
238+ run : exit 1
0 commit comments