|
13 | 13 | workflow_dispatch:
|
14 | 14 |
|
15 | 15 | jobs:
|
| 16 | + build: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] |
| 22 | + |
| 23 | + name: "Build Phar on PHP: ${{ matrix.php }}" |
| 24 | + |
| 25 | + continue-on-error: ${{ matrix.php == '8.2' }} |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout code |
| 29 | + uses: actions/checkout@v2 |
| 30 | + |
| 31 | + - name: Setup PHP |
| 32 | + uses: shivammathur/setup-php@v2 |
| 33 | + with: |
| 34 | + php-version: ${{ matrix.php }} |
| 35 | + coverage: none |
| 36 | + ini-values: phar.readonly=Off, error_reporting=-1, display_errors=On |
| 37 | + |
| 38 | + - name: Build the phar |
| 39 | + run: php scripts/build-phar.php |
| 40 | + |
| 41 | + - name: Upload the PHPCS phar |
| 42 | + uses: actions/upload-artifact@v2 |
| 43 | + if: ${{ success() && matrix.php == '7.4' }} |
| 44 | + with: |
| 45 | + name: phpcs-phar |
| 46 | + path: ./phpcs.phar |
| 47 | + if-no-files-found: error |
| 48 | + retention-days: 28 |
| 49 | + |
| 50 | + - name: Upload the PHPCBF phar |
| 51 | + uses: actions/upload-artifact@v2 |
| 52 | + if: ${{ success() && matrix.php == '7.4' }} |
| 53 | + with: |
| 54 | + name: phpcbf-phar |
| 55 | + path: ./phpcbf.phar |
| 56 | + if-no-files-found: error |
| 57 | + retention-days: 28 |
| 58 | + |
| 59 | + # Both the below only check a few files which are rarely changed and therefore unlikely to have issues. |
| 60 | + # This test is about testing that the phars are functional, *not* about whether the code style complies. |
| 61 | + - name: 'PHPCS: check code style using the Phar file to test the Phar is functional' |
| 62 | + run: php phpcs.phar ./scripts |
| 63 | + |
| 64 | + - name: 'PHPCBF: fix code style using the Phar file to test the Phar is functional' |
| 65 | + run: php phpcbf.phar ./scripts |
| 66 | + |
16 | 67 | test:
|
17 | 68 | runs-on: ubuntu-latest
|
| 69 | + needs: build |
18 | 70 |
|
19 | 71 | strategy:
|
20 | 72 | # Keys:
|
@@ -45,11 +97,11 @@ jobs:
|
45 | 97 | # Set the "short_open_tag" ini to make sure specific conditions are tested.
|
46 | 98 | # Also turn on error_reporting to ensure all notices are shown.
|
47 | 99 | if [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" == '5.5' ]]; then
|
48 |
| - echo '::set-output name=PHP_INI::phar.readonly=Off, error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On, asp_tags=On' |
| 100 | + echo '::set-output name=PHP_INI::error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On, asp_tags=On' |
49 | 101 | elif [[ ${{ matrix.custom_ini }} == true && "${{ matrix.php }}" == '7.0' ]]; then
|
50 |
| - echo '::set-output name=PHP_INI::phar.readonly=Off, error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On' |
| 102 | + echo '::set-output name=PHP_INI::error_reporting=-1, display_errors=On, date.timezone=Australia/Sydney, short_open_tag=On' |
51 | 103 | else
|
52 |
| - echo '::set-output name=PHP_INI::phar.readonly=Off, error_reporting=-1, display_errors=On' |
| 104 | + echo '::set-output name=PHP_INI::error_reporting=-1, display_errors=On' |
53 | 105 | fi
|
54 | 106 |
|
55 | 107 | - name: Install PHP
|
@@ -106,10 +158,12 @@ jobs:
|
106 | 158 | if: ${{ matrix.custom_ini == false }}
|
107 | 159 | run: composer validate --no-check-all --strict
|
108 | 160 |
|
109 |
| - - name: Build the phar |
110 |
| - if: ${{ matrix.custom_ini == false }} |
111 |
| - run: php scripts/build-phar.php |
| 161 | + - name: Download the PHPCS phar |
| 162 | + uses: actions/download-artifact@v2 |
| 163 | + with: |
| 164 | + name: phpcs-phar |
112 | 165 |
|
| 166 | + # This test specifically tests that the Phar which will be released works correctly on all PHP versions. |
113 | 167 | - name: 'PHPCS: check code style using the Phar file'
|
114 | 168 | if: ${{ matrix.custom_ini == false }}
|
115 | 169 | run: php phpcs.phar
|
0 commit comments