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