|
| 1 | +name: PHP Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [build] |
| 6 | + pull_request: |
| 7 | + branches: [build] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + services: |
| 14 | + mysql: |
| 15 | + image: mysql:8.3 |
| 16 | + env: |
| 17 | + MYSQL_ROOT_PASSWORD: '' |
| 18 | + MYSQL_ALLOW_EMPTY_PASSWORD: yes |
| 19 | + MYSQL_DATABASE: test |
| 20 | + ports: ['3306:3306'] |
| 21 | + options: >- |
| 22 | + --health-cmd="mysqladmin ping --silent" |
| 23 | + --health-interval=10s |
| 24 | + --health-timeout=5s |
| 25 | + --health-retries=5 |
| 26 | +
|
| 27 | + postgres: |
| 28 | + image: postgres:16 |
| 29 | + env: |
| 30 | + POSTGRES_PASSWORD: postgres |
| 31 | + POSTGRES_DB: test |
| 32 | + ports: ['5432:5432'] |
| 33 | + options: >- |
| 34 | + --health-cmd="pg_isready" |
| 35 | + --health-interval=10s |
| 36 | + --health-timeout=5s |
| 37 | + --health-retries=5 |
| 38 | +
|
| 39 | + steps: |
| 40 | + - name: Checkout php-async repo |
| 41 | + uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + path: async |
| 44 | + |
| 45 | + - name: Clone php-src (true-async-stable) |
| 46 | + run: | |
| 47 | + git clone --depth=1 --branch=true-async-stable https://github.com/true-async/php-src php-src |
| 48 | +
|
| 49 | + - name: Copy php-async extension into php-src |
| 50 | + run: | |
| 51 | + mkdir -p php-src/ext/async |
| 52 | + cp -r async/* php-src/ext/async/ |
| 53 | +
|
| 54 | + - name: Install build dependencies |
| 55 | + run: | |
| 56 | + sudo apt-get update |
| 57 | + sudo apt-get install -y \ |
| 58 | + gcc g++ autoconf bison re2c locales locales-all ldap-utils openssl slapd \ |
| 59 | + libgmp-dev libicu-dev libtidy-dev libenchant-2-dev libsasl2-dev libxpm-dev \ |
| 60 | + libzip-dev libbz2-dev libsqlite3-dev libwebp-dev libonig-dev libcurl4-openssl-dev \ |
| 61 | + libxml2-dev libxslt1-dev libpq-dev libreadline-dev libldap2-dev libsodium-dev \ |
| 62 | + libargon2-dev libsnmp-dev snmp snmp-mibs-downloader snmpd freetds-dev dovecot-core \ |
| 63 | + sendmail firebird-dev liblmdb-dev libtokyocabinet-dev libdb-dev libqdbm-dev \ |
| 64 | + libjpeg-dev libpng-dev libfreetype6-dev libuv1-dev |
| 65 | + g++ --version |
| 66 | + sudo mkdir -p /var/lib/snmp && sudo chown $(id -u):$(id -g) /var/lib/snmp |
| 67 | +
|
| 68 | + - name: Configure PHP |
| 69 | + working-directory: php-src |
| 70 | + run: | |
| 71 | + ./buildconf -f |
| 72 | + ./configure \ |
| 73 | + --enable-zts \ |
| 74 | + --enable-option-checking=fatal \ |
| 75 | + --prefix=/usr \ |
| 76 | + --disable-phpdbg \ |
| 77 | + --enable-fpm \ |
| 78 | + --enable-opcache \ |
| 79 | + --with-pdo-mysql=mysqlnd \ |
| 80 | + --with-mysqli=mysqlnd \ |
| 81 | + --with-pgsql \ |
| 82 | + --with-pdo-pgsql \ |
| 83 | + --with-pdo-sqlite \ |
| 84 | + --enable-intl \ |
| 85 | + --without-pear \ |
| 86 | + --enable-gd \ |
| 87 | + --with-jpeg \ |
| 88 | + --with-webp \ |
| 89 | + --with-freetype \ |
| 90 | + --with-xpm \ |
| 91 | + --enable-exif \ |
| 92 | + --with-zip \ |
| 93 | + --with-zlib \ |
| 94 | + --enable-soap \ |
| 95 | + --enable-xmlreader \ |
| 96 | + --with-xsl \ |
| 97 | + --with-tidy \ |
| 98 | + --enable-sysvsem \ |
| 99 | + --enable-sysvshm \ |
| 100 | + --enable-shmop \ |
| 101 | + --enable-pcntl \ |
| 102 | + --with-readline \ |
| 103 | + --enable-mbstring \ |
| 104 | + --with-curl \ |
| 105 | + --with-gettext \ |
| 106 | + --enable-sockets \ |
| 107 | + --with-bz2 \ |
| 108 | + --with-openssl \ |
| 109 | + --with-gmp \ |
| 110 | + --enable-bcmath \ |
| 111 | + --enable-calendar \ |
| 112 | + --enable-ftp \ |
| 113 | + --with-enchant=/usr \ |
| 114 | + --enable-sysvmsg \ |
| 115 | + --with-ffi \ |
| 116 | + --enable-zend-test \ |
| 117 | + --enable-dl-test=shared \ |
| 118 | + --with-ldap \ |
| 119 | + --with-ldap-sasl \ |
| 120 | + --with-password-argon2 \ |
| 121 | + --with-mhash \ |
| 122 | + --with-sodium \ |
| 123 | + --enable-dba \ |
| 124 | + --with-cdb \ |
| 125 | + --enable-flatfile \ |
| 126 | + --enable-inifile \ |
| 127 | + --with-tcadb \ |
| 128 | + --with-lmdb \ |
| 129 | + --with-qdbm \ |
| 130 | + --with-snmp \ |
| 131 | + --with-config-file-path=/etc \ |
| 132 | + --with-config-file-scan-dir=/etc/php.d \ |
| 133 | + --with-pdo-firebird \ |
| 134 | + --enable-async |
| 135 | +
|
| 136 | + - name: Build PHP |
| 137 | + working-directory: php-src |
| 138 | + run: | |
| 139 | + make -j"$(nproc)" |
| 140 | + sudo make install |
| 141 | + sudo mkdir -p /etc/php.d |
| 142 | + sudo chmod 777 /etc/php.d |
| 143 | + { |
| 144 | + echo "opcache.enable_cli=1" |
| 145 | + echo "opcache.protect_memory=1" |
| 146 | + } > /etc/php.d/opcache.ini |
| 147 | +
|
| 148 | + - name: Run tests |
| 149 | + working-directory: php-src |
| 150 | + env: |
| 151 | + MIBS: +ALL |
| 152 | + run: | |
| 153 | + sapi/cli/php run-tests.php \ |
| 154 | + -d zend_extension=opcache.so \ |
| 155 | + -d opcache.enable_cli=1 \ |
| 156 | + -d opcache.jit_buffer_size=64M \ |
| 157 | + -d opcache.jit=tracing \ |
| 158 | + -d zend_test.observer.enabled=1 \ |
| 159 | + -d zend_test.observer.show_output=0 \ |
| 160 | + -P -q -x -j2 \ |
| 161 | + -g FAIL,BORK,LEAK,XLEAK \ |
| 162 | + --no-progress \ |
| 163 | + --offline \ |
| 164 | + --show-diff \ |
| 165 | + --show-slow 1000 \ |
| 166 | + --set-timeout 120 \ |
| 167 | + --repeat 2 |
0 commit comments