diff --git a/.github/actions/setup-windows/action.yml b/.github/actions/setup-windows/action.yml index 4786242455a1..aa3b12c76bcf 100644 --- a/.github/actions/setup-windows/action.yml +++ b/.github/actions/setup-windows/action.yml @@ -5,7 +5,31 @@ runs: - name: Setup MySQL shell: pwsh run: | - choco install mysql -y --no-progress --params="/port:3306" + try { + # Try installing MySQL from default choco + choco install mysql -y --no-progress --params="/port:3306" + if (-not $?) { + throw "Chocolatey MySQL installation failed. Falling back to manual installation." + } + } catch { + Write-Host "Default MySQL installation failed (likely 403 from dev.mysql.com). Fallback to backup ZIP..." + $backupUrl = "https://github.com/divinity76/php-src/releases/download/mysql-8.0.31-winx64.zip/mysql-8.0.31-winx64.zip" + $destination = "C:\tools\mysql-8.0.31-winx64.zip" + Invoke-WebRequest -Uri $backupUrl -OutFile $destination + # 3) Expand the ZIP into C:\tools\mysql + Expand-Archive -Path $destination -DestinationPath "C:\tools\mysql" + # 4) Point to the MySQL bin directory in the environment PATH (for the current session) + $mysqlDir = "C:\tools\mysql\mysql-8.0.31-winx64" + $env:Path += ";$mysqlDir\bin" + # 5) Initialize the MySQL data directory (insecure init => empty root password) + & "$mysqlDir\bin\mysqld.exe" --initialize-insecure --datadir="$mysqlDir\data" + # 6) Install MySQL as a Windows service named "MySQL80" + & "$mysqlDir\bin\mysqld.exe" --install MySQL80 --datadir="$mysqlDir\data" + # 7) Start the MySQL service + Start-Service MySQL80 + # (Optional) Wait a few seconds to ensure MySQL is fully up: + Start-Sleep -Seconds 2 + } mysql.exe --port=3306 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password12!'; FLUSH PRIVILEGES;" - name: Setup MSSQL shell: pwsh diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c2816d72cf18..4c8ec23b158a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -427,7 +427,7 @@ jobs: -d zend_extension=opcache.so -d opcache.enable_cli=1 - uses: codecov/codecov-action@v4 - if: !cancelled() + if: ${{ !cancelled() }} with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} @@ -500,7 +500,7 @@ jobs: echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini php -v - name: Test AMPHP - if: !cancelled() + if: ${{ !cancelled() }} run: | repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server" X=0 @@ -518,7 +518,7 @@ jobs: done exit $X - name: Test Laravel - if: !cancelled() + if: ${{ !cancelled() }} run: | git clone https://github.com/laravel/framework.git --branch=master --depth=1 cd framework @@ -531,7 +531,7 @@ jobs: exit 1 fi - name: Test ReactPHP - if: !cancelled() + if: ${{ !cancelled() }} run: | repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream" X=0 @@ -549,7 +549,7 @@ jobs: done exit $X - name: Test Revolt PHP - if: !cancelled() + if: ${{ !cancelled() }} run: | git clone https://github.com/revoltphp/event-loop.git --depth=1 cd event-loop @@ -560,7 +560,7 @@ jobs: exit 1 fi - name: Test Symfony - if: !cancelled() && !inputs.skip_symfony + if: ${{ !cancelled() && !inputs.skip_symfony }} run: | git clone https://github.com/symfony/symfony.git --depth=1 cd symfony @@ -581,7 +581,7 @@ jobs: done exit $X - name: Test PHPUnit - if: !cancelled() + if: ${{ !cancelled() }} run: | git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1 cd phpunit @@ -592,7 +592,7 @@ jobs: exit 1 fi - name: 'Symfony Preloading' - if: !cancelled() && !inputs.skip_symfony + if: ${{ !cancelled() && !inputs.skip_symfony }} run: | php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs cd symfony_demo @@ -600,7 +600,7 @@ jobs: sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php - name: Test Wordpress - if: !cancelled() && !inputs.skip_wordpress + if: ${{ !cancelled() && !inputs.skip_wordpress }} run: | git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1 cd wordpress