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