Skip to content

Commit 0f99255

Browse files
localheinzsebastianbergmann
authored andcommitted
Enhancement: Split building and testing the PHAR
1 parent f9a161c commit 0f99255

File tree

1 file changed

+56
-9
lines changed

1 file changed

+56
-9
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,53 @@ jobs:
210210
- name: Assert that git tree is clean
211211
run: git diff || echo "Run 'php build/scripts/generate-global-assert-wrappers.php' to regenerate global assert wrappers!"
212212

213-
build-and-test-phar:
214-
name: Build and test PHAR
213+
build-phar:
214+
name: Build PHAR
215+
216+
runs-on: ubuntu-latest
217+
218+
env:
219+
PHP_EXTENSIONS: none, dom, json, fileinfo, iconv, libxml, mbstring, pdo_sqlite, phar, soap, tokenizer, xml, xmlwriter
220+
PHP_INI_VALUES: assert.exception=1, phar.readonly=0, zend.assertions=1
221+
222+
strategy:
223+
matrix:
224+
php-version:
225+
- "8.1"
226+
227+
steps:
228+
- name: Checkout
229+
uses: actions/checkout@v2
230+
231+
- name: Install PHP with extensions
232+
uses: shivammathur/setup-php@v2
233+
with:
234+
php-version: ${{ matrix.php-version }}
235+
coverage: none
236+
extensions: ${{ env.PHP_EXTENSIONS }}
237+
ini-values: ${{ env.PHP_INI_VALUES }}
238+
tools: none
239+
240+
- name: Install java
241+
uses: actions/setup-java@v1
242+
with:
243+
java-version: 1.8
244+
245+
- name: Build PHAR
246+
run: ant phar-snapshot
247+
248+
- name: Upload PHAR
249+
uses: actions/upload-artifact@v2
250+
with:
251+
name: phpunit-snapshot-phar
252+
path: ./build/artifacts/phpunit-snapshot.phar
253+
retention-days: 7
254+
255+
test-phar:
256+
name: Test PHAR
257+
258+
needs:
259+
- build-phar
215260

216261
runs-on: ubuntu-latest
217262

@@ -246,12 +291,14 @@ jobs:
246291
with:
247292
java-version: 1.8
248293

249-
- name: Build PHAR and run the PHAR-specific tests with it
250-
run: ant build-phar-and-run-phar-specific-tests
251-
252-
- uses: actions/upload-artifact@v2
253-
if: ${{ matrix.php-version == 8.1 }}
294+
- name: Download PHAR
295+
uses: actions/download-artifact@v2
254296
with:
255297
name: phpunit-snapshot-phar
256-
path: ./build/artifacts/phpunit-snapshot.phar
257-
retention-days: 7
298+
path: ./build/artifacts/
299+
300+
- name: Make PHAR exexutable
301+
run: chmod +x ./build/artifacts/phpunit-snapshot.phar
302+
303+
- name: Run PHAR-specific tests
304+
run: ant run-phar-specific-tests

0 commit comments

Comments
 (0)