xref: /PHP-8.2/.github/workflows/nightly.yml (revision 50d5e96e)
1name: Nightly
2on:
3  schedule:
4   - cron: "0 1 * * *"
5  workflow_dispatch: ~
6jobs:
7  GENERATE_MATRIX:
8    name: Generate Matrix
9    if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
10    runs-on: ubuntu-latest
11    outputs:
12      branches: ${{ steps.set-matrix.outputs.branches }}
13      matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
14      windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
15    steps:
16      - uses: actions/checkout@v4
17        with:
18          # Set fetch-depth to 0 to clone the full repository
19          # including all branches. This is required to find
20          # the correct commit hashes.
21          fetch-depth: 0
22      - name: Grab the commit mapping
23        uses: actions/cache@v3
24        with:
25          path: branch-commit-cache.json
26          # The cache key needs to change every time for the
27          # cache to be updated after this job finishes.
28          key: nightly-${{ github.run_id }}-${{ github.run_attempt }}
29          restore-keys: |
30            nightly-
31      - name: Generate Matrix
32        id: set-matrix
33        run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}"
34      - name: Notify Slack
35        if: failure()
36        uses: ./.github/actions/notify-slack
37        with:
38          token: ${{ secrets.ACTION_MONITORING_SLACK }}
39  LINUX_X64:
40    needs: GENERATE_MATRIX
41    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
42    services:
43      mysql:
44        image: mysql:8.3
45        ports:
46          - 3306:3306
47        env:
48          MYSQL_DATABASE: test
49          MYSQL_ROOT_PASSWORD: root
50      postgres:
51        image: postgres
52        env:
53          POSTGRES_USER: postgres
54          POSTGRES_PASSWORD: postgres
55          POSTGRES_DB: test
56    strategy:
57      fail-fast: false
58      matrix:
59        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
60        configuration_parameters: ['']
61        debug: [true, false]
62        name: ['']
63        run_tests_parameters: ['']
64        test_function_jit: [true]
65        zts: [true, false]
66        include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }}
67    name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
68    runs-on: ubuntu-20.04
69    steps:
70      - name: git checkout
71        uses: actions/checkout@v4
72        with:
73          ref: ${{ matrix.branch.ref }}
74      - name: Create MSSQL container
75        uses: ./.github/actions/setup-mssql
76      - name: Create Oracle container
77        uses: ./.github/actions/setup-oracle
78      - name: apt
79        uses: ./.github/actions/apt-x64
80      - name: ./configure
81        uses: ./.github/actions/configure-x64
82        with:
83          configurationParameters: >-
84            ${{ matrix.configuration_parameters }}
85            --${{ matrix.debug && 'enable' || 'disable' }}-debug
86            --${{ matrix.zts && 'enable' || 'disable' }}-zts
87      - name: make
88        run: make -j$(/usr/bin/nproc) >/dev/null
89      - name: make install
90        uses: ./.github/actions/install-linux
91      - name: Setup
92        uses: ./.github/actions/setup-x64
93      - name: Test
94        uses: ./.github/actions/test-linux
95        with:
96          runTestsParameters: >-
97            ${{ matrix.run_tests_parameters }}
98          idleCpu: ${{ matrix.asan && 'true' || 'false' }}
99      - name: Test Tracing JIT
100        uses: ./.github/actions/test-linux
101        with:
102          jitType: tracing
103          runTestsParameters: >-
104            ${{ matrix.run_tests_parameters }}
105            -d zend_extension=opcache.so
106            -d opcache.enable_cli=1
107      - name: Test OpCache
108        uses: ./.github/actions/test-linux
109        with:
110          runTestsParameters: >-
111            ${{ matrix.run_tests_parameters }}
112            -d zend_extension=opcache.so
113            -d opcache.enable_cli=1
114      - name: Test Function JIT
115        # ASAN frequently timeouts. Each test run takes ~90 minutes, we can
116        # avoid running into the 6 hour timeout by skipping the function JIT.
117        if: matrix.test_function_jit
118        uses: ./.github/actions/test-linux
119        with:
120          jitType: function
121          runTestsParameters: >-
122            ${{ matrix.run_tests_parameters }}
123            -d zend_extension=opcache.so
124            -d opcache.enable_cli=1
125      - name: Verify generated files are up to date
126        uses: ./.github/actions/verify-generated-files
127      - name: Notify Slack
128        if: failure()
129        uses: ./.github/actions/notify-slack
130        with:
131          token: ${{ secrets.ACTION_MONITORING_SLACK }}
132  LINUX_X32:
133    needs: GENERATE_MATRIX
134    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
135    strategy:
136      fail-fast: false
137      matrix:
138        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
139        debug: [true, false]
140        zts: [true, false]
141    name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
142    runs-on: ubuntu-latest
143    container:
144      image: ubuntu:20.04
145    env:
146      MYSQL_TEST_HOST: mysql
147      PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test
148      PDO_MYSQL_TEST_HOST: mysql
149    services:
150      mysql:
151        image: mysql:8
152        ports:
153          - 3306:3306
154        env:
155          MYSQL_DATABASE: test
156          MYSQL_ROOT_PASSWORD: root
157    steps:
158      - name: git checkout
159        uses: actions/checkout@v4
160        with:
161          ref: ${{ matrix.branch.ref }}
162      - name: apt
163        uses: ./.github/actions/apt-x32
164      - name: ./configure
165        uses: ./.github/actions/configure-x32
166        with:
167          configurationParameters: >-
168            --${{ matrix.debug && 'enable' || 'disable' }}-debug
169            --${{ matrix.zts && 'enable' || 'disable' }}-zts
170      - name: make
171        run: make -j$(/usr/bin/nproc) >/dev/null
172      - name: make install
173        uses: ./.github/actions/install-linux-x32
174      - name: Test
175        uses: ./.github/actions/test-linux
176        with:
177          runTestsParameters: >-
178            ${{ matrix.run_tests_parameters }}
179      - name: Test Tracing JIT
180        uses: ./.github/actions/test-linux
181        with:
182          jitType: tracing
183          runTestsParameters: >-
184            ${{ matrix.run_tests_parameters }}
185            -d zend_extension=opcache.so
186            -d opcache.enable_cli=1
187      - name: Test OpCache
188        uses: ./.github/actions/test-linux
189        with:
190          runTestsParameters: >-
191            ${{ matrix.run_tests_parameters }}
192            -d zend_extension=opcache.so
193            -d opcache.enable_cli=1
194      - name: Test Function JIT
195        uses: ./.github/actions/test-linux
196        with:
197          jitType: function
198          runTestsParameters: >-
199            ${{ matrix.run_tests_parameters }}
200            -d zend_extension=opcache.so
201            -d opcache.enable_cli=1
202      - name: Notify Slack
203        if: failure()
204        uses: ./.github/actions/notify-slack
205        with:
206          token: ${{ secrets.ACTION_MONITORING_SLACK }}
207  MACOS:
208    needs: GENERATE_MATRIX
209    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
210    strategy:
211      fail-fast: false
212      matrix:
213        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
214        debug: [true, false]
215        zts: [true, false]
216    name: "${{ matrix.branch.name }}_MACOS_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
217    runs-on: macos-12
218    steps:
219      - name: git checkout
220        uses: actions/checkout@v4
221        with:
222          ref: ${{ matrix.branch.ref }}
223      - name: brew
224        uses: ./.github/actions/brew
225      - name: ./configure
226        uses: ./.github/actions/configure-macos
227        with:
228          configurationParameters: >-
229            --${{ matrix.debug && 'enable' || 'disable' }}-debug
230            --${{ matrix.zts && 'enable' || 'disable' }}-zts
231      - name: make
232        run: |-
233          export PATH="/usr/local/opt/bison/bin:$PATH"
234          make -j$(sysctl -n hw.logicalcpu) >/dev/null
235      - name: make install
236        run: sudo make install
237      - name: Test
238        uses: ./.github/actions/test-macos
239      - name: Test Tracing JIT
240        uses: ./.github/actions/test-macos
241        with:
242          jitType: tracing
243          runTestsParameters: >-
244            -d zend_extension=opcache.so
245            -d opcache.enable_cli=1
246            -d opcache.protect_memory=1
247      - name: Test OpCache
248        uses: ./.github/actions/test-macos
249        with:
250          runTestsParameters: >-
251            -d zend_extension=opcache.so
252            -d opcache.enable_cli=1
253            -d opcache.protect_memory=1
254      - name: Test Function JIT
255        uses: ./.github/actions/test-macos
256        with:
257          jitType: function
258          runTestsParameters: >-
259            -d zend_extension=opcache.so
260            -d opcache.enable_cli=1
261            -d opcache.protect_memory=1
262      - name: Verify generated files are up to date
263        uses: ./.github/actions/verify-generated-files
264      - name: Notify Slack
265        if: failure()
266        uses: ./.github/actions/notify-slack
267        with:
268          token: ${{ secrets.ACTION_MONITORING_SLACK }}
269  COVERAGE_DEBUG_NTS:
270    if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch'
271    runs-on: ubuntu-20.04
272    services:
273      mysql:
274        image: mysql:8.3
275        ports:
276          - 3306:3306
277        env:
278          MYSQL_DATABASE: test
279          MYSQL_ROOT_PASSWORD: root
280      postgres:
281        image: postgres
282        env:
283          POSTGRES_USER: postgres
284          POSTGRES_PASSWORD: postgres
285          POSTGRES_DB: test
286    steps:
287      - name: git checkout
288        uses: actions/checkout@v4
289      - name: Create MSSQL container
290        uses: ./.github/actions/setup-mssql
291      - name: Create Oracle container
292        uses: ./.github/actions/setup-oracle
293      - name: apt
294        uses: ./.github/actions/apt-x64
295      - name: Install gcovr
296        run: sudo -H pip install gcovr
297      - name: ./configure
298        uses: ./.github/actions/configure-x64
299        with:
300          configurationParameters: --enable-debug --disable-zts --enable-gcov
301      - name: make
302        run: make -j$(/usr/bin/nproc) >/dev/null
303      - name: make install
304        uses: ./.github/actions/install-linux
305      - name: Setup
306        uses: ./.github/actions/setup-x64
307      # We only test with OpCache, the difference in coverage is negligible
308      - name: Test OpCache
309        uses: ./.github/actions/test-linux
310        with:
311          runTestsParameters: >-
312            -d zend_extension=opcache.so
313            -d opcache.enable_cli=1
314      - name: Upload Test Coverage to Codecov.io
315        if: always()
316        run: bash <(curl -s https://codecov.io/bash)
317      - name: Notify Slack
318        if: failure()
319        uses: ./.github/actions/notify-slack
320        with:
321          token: ${{ secrets.ACTION_MONITORING_SLACK }}
322  COMMUNITY:
323    needs: GENERATE_MATRIX
324    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
325    strategy:
326      fail-fast: false
327      matrix:
328        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
329    name: "${{ matrix.branch.name }}_COMMUNITY"
330    runs-on: ubuntu-20.04
331    env:
332      UBSAN_OPTIONS: print_stacktrace=1
333      USE_ZEND_ALLOC: 0
334      USE_TRACKED_ALLOC: 1
335    steps:
336      - name: git checkout
337        uses: actions/checkout@v4
338        with:
339          ref: ${{ matrix.branch.ref }}
340      - name: apt
341        uses: ./.github/actions/apt-x64
342      - name: ./configure
343        uses: ./.github/actions/configure-x64
344        with:
345          configurationParameters: >-
346            --enable-debug
347            --enable-zts
348            CFLAGS='-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC'
349            LDFLAGS='-fsanitize=undefined,address'
350      - name: make
351        run: make -j$(/usr/bin/nproc) >/dev/null
352      - name: make install
353        uses: ./.github/actions/install-linux
354      - name: Setup
355        run: |
356          sudo service mysql start
357          mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
358          mysql -uroot -proot -e "SET GLOBAL local_infile = true"
359      - name: Enable Opcache and JIT
360        run: |
361          echo zend_extension=opcache.so > /etc/php.d/opcache.ini
362          echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
363          echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
364          echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
365      - name: Test Laravel
366        if: matrix.branch.ref != 'PHP-8.0'
367        run: |
368          git clone https://github.com/laravel/framework.git --branch=master --depth=1
369          cd framework
370          git rev-parse HEAD
371          php /usr/bin/composer install --no-progress --ignore-platform-reqs
372          # Hack to disable a test that hangs
373          php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n    public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);'
374          export ASAN_OPTIONS=exitcode=139
375          php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$?
376          if [ $EXIT_CODE -gt 128 ]; then
377            exit 1
378          fi
379      - name: Test Symfony
380        if: matrix.branch.ref != 'PHP-8.0'
381        run: |
382          git clone https://github.com/symfony/symfony.git --depth=1
383          cd symfony
384          git rev-parse HEAD
385          php /usr/bin/composer install --no-progress --ignore-platform-reqs
386          php ./phpunit install
387          # Test causes a heap-buffer-overflow but I cannot reproduce it locally...
388          php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n    public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
389          # Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
390          php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("public function testCastNonTrailingCharPointer()", "/** @group skip */\n    public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
391          export ASAN_OPTIONS=exitcode=139
392          export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
393          X=0
394          for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
395            php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$?
396            if [ $EXIT_CODE -gt 128 ]; then
397              X=1;
398            fi
399          done
400          exit $X
401      - name: Test PHPUnit
402        if: always()
403        run: |
404          git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1
405          cd phpunit
406          git rev-parse HEAD
407          export ASAN_OPTIONS=exitcode=139
408          php /usr/bin/composer install --no-progress --ignore-platform-reqs
409          php ./phpunit || EXIT_CODE=$?
410          if [ $EXIT_CODE -gt 128 ]; then
411            exit 1
412          fi
413      - name: 'Symfony Preloading'
414        if: matrix.branch.ref != 'PHP-8.0'
415        run: |
416          php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs
417          cd symfony_demo
418          git rev-parse HEAD
419          sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php
420          php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php
421      - name: Test Wordpress
422        if: always()
423        run: |
424          git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1
425          cd wordpress
426          git rev-parse HEAD
427          export ASAN_OPTIONS=exitcode=139
428          php /usr/bin/composer install --no-progress --ignore-platform-reqs
429          cp wp-tests-config-sample.php wp-tests-config.php
430          sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php
431          sed -i 's/yourusernamehere/root/g' wp-tests-config.php
432          sed -i 's/yourpasswordhere/root/g' wp-tests-config.php
433          php vendor/bin/phpunit || EXIT_CODE=$?
434          if [ $EXIT_CODE -gt 128 ]; then
435            exit 1
436          fi
437      - name: Notify Slack
438        if: failure()
439        uses: ./.github/actions/notify-slack
440        with:
441          token: ${{ secrets.ACTION_MONITORING_SLACK }}
442  OPCACHE_VARIATION:
443    needs: GENERATE_MATRIX
444    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
445    services:
446      mysql:
447        image: mysql:8.3
448        ports:
449          - 3306:3306
450        env:
451          MYSQL_DATABASE: test
452          MYSQL_ROOT_PASSWORD: root
453      postgres:
454        image: postgres
455        env:
456          POSTGRES_USER: postgres
457          POSTGRES_PASSWORD: postgres
458          POSTGRES_DB: test
459    strategy:
460      fail-fast: false
461      matrix:
462        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
463    name: "${{ matrix.branch.name }}_OPCACHE_VARIATION"
464    runs-on: ubuntu-20.04
465    steps:
466      - name: git checkout
467        uses: actions/checkout@v4
468        with:
469          ref: ${{ matrix.branch.ref }}
470      - name: Create MSSQL container
471        uses: ./.github/actions/setup-mssql
472      - name: Create Oracle container
473        uses: ./.github/actions/setup-oracle
474      - name: apt
475        uses: ./.github/actions/apt-x64
476      - name: ./configure
477        uses: ./.github/actions/configure-x64
478        with:
479          configurationParameters: >-
480            --enable-debug --disable-zts
481      - name: make
482        run: make -j$(/usr/bin/nproc) >/dev/null
483      - name: make install
484        uses: ./.github/actions/install-linux
485      - name: Setup
486        uses: ./.github/actions/setup-x64
487      - name: Test File Cache (prime shm)
488        uses: ./.github/actions/test-linux
489        with:
490          runTestsParameters: >-
491            -d zend_extension=opcache.so
492            -d opcache.enable_cli=1
493            --file-cache-prime
494      - name: Test File Cache (prime shm, use shm)
495        uses: ./.github/actions/test-linux
496        with:
497          runTestsParameters: >-
498            -d zend_extension=opcache.so
499            -d opcache.enable_cli=1
500            --file-cache-use
501      - name: Test File Cache (prime shm, use file)
502        uses: ./.github/actions/test-linux
503        with:
504          runTestsParameters: >-
505            -d zend_extension=opcache.so
506            -d opcache.enable_cli=1
507            --file-cache-use
508            -d opcache.file_cache_only=1
509      - name: Test File Cache Only (prime)
510        uses: ./.github/actions/test-linux
511        with:
512          runTestsParameters: >-
513            -d zend_extension=opcache.so
514            -d opcache.enable_cli=1
515            --file-cache-prime
516            -d opcache.file_cache_only=1
517      - name: Test File Cache Only (use)
518        uses: ./.github/actions/test-linux
519        with:
520          runTestsParameters: >-
521            -d zend_extension=opcache.so
522            -d opcache.enable_cli=1
523            --file-cache-use
524            -d opcache.file_cache_only=1
525      - name: Verify generated files are up to date
526        uses: ./.github/actions/verify-generated-files
527      - name: Notify Slack
528        if: failure()
529        uses: ./.github/actions/notify-slack
530        with:
531          token: ${{ secrets.ACTION_MONITORING_SLACK }}
532  MSAN:
533    needs: GENERATE_MATRIX
534    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
535    strategy:
536      fail-fast: false
537      matrix:
538        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
539    name: "${{ matrix.branch.name }}_MSAN"
540    runs-on: ubuntu-22.04
541    steps:
542      - name: git checkout
543        uses: actions/checkout@v4
544        with:
545          ref: ${{ matrix.branch.ref }}
546      - name: apt
547        uses: ./.github/actions/apt-x64
548      - name: ./configure
549        run: |
550          export CC=clang
551          export CXX=clang++
552          export CFLAGS="-DZEND_TRACK_ARENA_ALLOC"
553          ./buildconf --force
554          # msan requires all used libraries to be instrumented,
555          # so we should avoiding linking against anything but libc here
556          ./configure \
557            --enable-debug \
558            --enable-zts \
559            --enable-option-checking=fatal \
560            --prefix=/usr \
561            --without-sqlite3 \
562            --without-pdo-sqlite \
563            --without-libxml \
564            --disable-dom \
565            --disable-simplexml \
566            --disable-xml \
567            --disable-xmlreader \
568            --disable-xmlwriter \
569            --without-pcre-jit \
570            --disable-opcache-jit \
571            --enable-phpdbg \
572            --enable-fpm \
573            --with-pdo-mysql=mysqlnd \
574            --with-mysqli=mysqlnd \
575            --disable-mysqlnd-compression-support \
576            --without-pear \
577            --enable-exif \
578            --enable-sysvsem \
579            --enable-sysvshm \
580            --enable-shmop \
581            --enable-pcntl \
582            --enable-mbstring \
583            --disable-mbregex \
584            --enable-sockets \
585            --enable-bcmath \
586            --enable-calendar \
587            --enable-ftp \
588            --enable-zend-test \
589            --enable-werror \
590            --enable-memory-sanitizer \
591            --with-config-file-path=/etc \
592            --with-config-file-scan-dir=/etc/php.d
593      - name: make
594        run: make -j$(/usr/bin/nproc) >/dev/null
595      - name: make install
596        run: |
597          sudo make install
598          sudo mkdir -p /etc/php.d
599          sudo chmod 777 /etc/php.d
600          echo mysqli.default_socket=/var/run/mysqld/mysqld.sock    > /etc/php.d/mysqli.ini
601          echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
602      - name: Setup
603        run: |
604          set -x
605          sudo service mysql start
606          mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
607          # Ensure local_infile tests can run.
608          mysql -uroot -proot -e "SET GLOBAL local_infile = true"
609          sudo locale-gen de_DE
610      - name: Test
611        uses: ./.github/actions/test-linux
612        with:
613          runTestsParameters: >-
614            --msan
615      - name: Test Opcache
616        uses: ./.github/actions/test-linux
617        with:
618          runTestsParameters: >-
619            --msan
620            -d zend_extension=opcache.so
621            -d opcache.enable_cli=1
622      - name: Verify generated files are up to date
623        uses: ./.github/actions/verify-generated-files
624      - name: Notify Slack
625        if: failure()
626        uses: ./.github/actions/notify-slack
627        with:
628          token: ${{ secrets.ACTION_MONITORING_SLACK }}
629  LIBMYSQLCLIENT:
630    needs: GENERATE_MATRIX
631    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
632    strategy:
633      fail-fast: false
634      matrix:
635        branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
636        exclude:
637          - branch: { name: 'PHP-80', ref: 'PHP-8.0' }
638    name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT"
639    runs-on: ubuntu-20.04
640    steps:
641      - name: git checkout
642        uses: actions/checkout@v4
643        with:
644          ref: ${{ matrix.branch.ref }}
645      - name: apt
646        run: |
647          sudo apt-get update -y | true
648          sudo apt install bison re2c
649      - name: Setup
650        run: |
651          sudo service mysql start
652          mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
653          # Ensure local_infile tests can run.
654          mysql -uroot -proot -e "SET GLOBAL local_infile = true"
655      # Does not support caching_sha2_auth :(
656      # - name: Build mysql-5.6
657      #  uses: ./.github/actions/build-libmysqlclient
658      #  with:
659      #    libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz
660      # - name: Test mysql-5.6
661      #   uses: ./.github/actions/test-libmysqlclient
662      - name: Build mysql-5.7
663        uses: ./.github/actions/build-libmysqlclient
664        with:
665          libmysql: mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz
666          withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
667      - name: Test mysql-5.7
668        uses: ./.github/actions/test-libmysqlclient
669        with:
670          withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
671      - name: Build mysql-8.0
672        uses: ./.github/actions/build-libmysqlclient
673        with:
674          # FIXME: There are new warnings
675          # configurationParameters: --enable-werror
676          libmysql: mysql-8.0.33-linux-glibc2.12-x86_64.tar.xz
677          withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
678      - name: Test mysql-8.0
679        uses: ./.github/actions/test-libmysqlclient
680        with:
681          withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }}
682      - name: Verify generated files are up to date
683        uses: ./.github/actions/verify-generated-files
684      - name: Notify Slack
685        if: failure()
686        uses: ./.github/actions/notify-slack
687        with:
688          token: ${{ secrets.ACTION_MONITORING_SLACK }}
689  WINDOWS:
690    needs: GENERATE_MATRIX
691    if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
692    strategy:
693      fail-fast: false
694      matrix:
695        include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
696    name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
697    runs-on: windows-2019
698    env:
699      PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
700      PHP_BUILD_OBJ_DIR: C:\obj
701      PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk
702      PHP_BUILD_SDK_BRANCH: php-sdk-2.3.0
703      PHP_BUILD_CRT: vs16
704      PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
705      THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}"
706      INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}"
707      PARALLEL: -j2
708      OPCACHE: "${{ matrix.opcache && '1' || '0' }}"
709    steps:
710      - name: git config
711        run: git config --global core.autocrlf false && git config --global core.eol lf
712      - name: git checkout
713        uses: actions/checkout@v4
714        with:
715          ref: ${{ matrix.branch.ref }}
716      - name: Setup
717        uses: ./.github/actions/setup-windows
718      - name: Build
719        run: .github/scripts/windows/build.bat
720      - name: Test
721        run: .github/scripts/windows/test.bat
722