|
7 | 7 | - "master" |
8 | 8 | workflow_dispatch: |
9 | 9 |
|
10 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
11 | 10 | jobs: |
12 | | - # This workflow contains a single job called "build" |
13 | 11 | build: |
14 | | - name: PHP ${{ matrix.php }} ZTS ${{ matrix.zts }} OPcache ${{ matrix.opcache }} |
15 | | - # The type of runner that the job will run on |
16 | | - runs-on: ubuntu-20.04 |
| 12 | + name: PHP ${{ matrix.php }} PHPTS ${{ matrix.phpts }} OPcache ${{ matrix.opcache }} |
| 13 | + runs-on: ubuntu-22.04 |
17 | 14 | strategy: |
18 | 15 | fail-fast: false |
19 | 16 | matrix: |
20 | 17 | php: |
21 | | - - 7.4.14 |
22 | | - - 8.0.1 |
23 | | - - 8.1snapshot |
24 | | - - 8.2snapshot |
25 | | - - 8.3snapshot |
26 | | - - 8.4snapshot |
27 | | - zts: [on, off] |
28 | | - opcache: [on, off] |
| 18 | + - "7.4" |
| 19 | + - "8.0" |
| 20 | + - "8.1" |
| 21 | + - "8.2" |
| 22 | + - "8.3" |
| 23 | + - "8.4" |
| 24 | + phpts: ["ts", "nts"] |
| 25 | + opcache: [1, 0] |
| 26 | + |
29 | 27 | steps: |
30 | 28 | - uses: actions/checkout@v2 |
31 | 29 |
|
32 | | - - name: Restore PHP build cache |
33 | | - id: php-build-cache |
34 | | - uses: actions/cache@v2 |
35 | | - with: |
36 | | - path: ${{ github.workspace }}/php |
37 | | - key: php-build-${{ matrix.php }}-zts-${{ matrix.zts }} |
38 | | - |
39 | | - - name: Clone php-build/php-build |
40 | | - uses: actions/checkout@v2 |
| 30 | + - name: Setup PHP |
| 31 | + uses: shivammathur/setup-php@v2 |
41 | 32 | with: |
42 | | - repository: php-build/php-build |
43 | | - path: ${{ github.workspace }}/php-build |
44 | | - |
45 | | - - name: Install PHP dependencies |
46 | | - run: ${{ github.workspace }}/php-build/install-dependencies.sh |
47 | | - |
48 | | - - name: Compile PHP |
49 | | - if: steps.php-build-cache.outputs.cache-hit != 'true' |
50 | | - run: | |
51 | | - cd ${{ github.workspace }}/php-build |
52 | | - ./install-dependencies.sh |
53 | | - PHP_BUILD_ZTS_ENABLE=${{ matrix.zts }} ./bin/php-build ${{ matrix.php }} ${{ github.workspace }}/php |
| 33 | + php-version: ${{ matrix.php }} |
| 34 | + ini-values: opcache.enable_cli=${{ matrix.opcache }} |
| 35 | + env: |
| 36 | + phpts: ${{ matrix.phpts }} |
54 | 37 |
|
55 | 38 | - name: Install extension |
| 39 | + working-directory: ${{ github.workspace }} |
56 | 40 | run: | |
57 | | - cd ${{ github.workspace }} |
58 | | - ${{ github.workspace }}/php/bin/phpize |
59 | | - ./configure --with-php-config=${{ github.workspace }}/php/bin/php-config |
60 | | - make -j8 install |
61 | | - echo "extension=ds.so" > ${{ github.workspace }}/php/etc/conf.d/ds.ini |
62 | | - rm ${{ github.workspace }}/php/etc/conf.d/xdebug.ini || true |
63 | | -
|
64 | | - - name: Prefix PHP to PATH |
65 | | - run: echo "${{ github.workspace }}/php/bin" >> $GITHUB_PATH |
| 41 | + phpize |
| 42 | + ./configure --with-php-config=/usr/bin/php-config |
| 43 | + sudo make -j8 install |
66 | 44 |
|
67 | | - - name: Generate OPcache configuration |
68 | | - run: echo "opcache.enable_cli=${{ matrix.opcache }}" > ${{ github.workspace }}/php/etc/conf.d/opcache.ini |
69 | | - |
70 | | - - name: Install Composer |
71 | | - run: curl -sS https://getcomposer.org/installer | php |
72 | | - - name: Restore Composer package cache |
73 | | - uses: actions/cache@v2 |
| 45 | + - name: "Install dependencies with Composer" |
| 46 | + uses: "ramsey/composer-install@v3" |
74 | 47 | with: |
75 | | - path: | |
76 | | - ~/.cache/composer/files |
77 | | - ~/.cache/composer/vcs |
78 | | - key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.json') }}" |
79 | | - restore-keys: | |
80 | | - composer-v2-cache- |
81 | | -
|
82 | | - - name: Install Composer dependencies |
83 | | - run: php composer.phar install --prefer-dist --no-interaction |
| 48 | + composer-options: "--prefer-dist" |
84 | 49 |
|
85 | 50 | - name: Run PHPUnit tests |
86 | | - run: php composer.phar test |
| 51 | + run: composer test |
0 commit comments