Skip to content

Commit 75157d7

Browse files
authored
Merge pull request #211 from simPod/build
Migrate to shivammathur/setup-php, finally run on php8.4 and make CI pass
2 parents da4d2f2 + 86ff123 commit 75157d7

File tree

1 file changed

+25
-60
lines changed

1 file changed

+25
-60
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -7,80 +7,45 @@ on:
77
- "master"
88
workflow_dispatch:
99

10-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1110
jobs:
12-
# This workflow contains a single job called "build"
1311
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
1714
strategy:
1815
fail-fast: false
1916
matrix:
2017
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+
2927
steps:
3028
- uses: actions/checkout@v2
3129

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
4132
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 }}
5437

5538
- name: Install extension
39+
working-directory: ${{ github.workspace }}
5640
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
6644
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"
7447
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"
8449

8550
- name: Run PHPUnit tests
86-
run: php composer.phar test
51+
run: composer test

0 commit comments

Comments
 (0)