Skip to content

Commit 543c4fa

Browse files
committed
Combine Redis and Memcached setup steps in Windows CI workflow for streamlined integration.
1 parent 8254d64 commit 543c4fa

1 file changed

Lines changed: 22 additions & 14 deletions

File tree

.github/workflows/continuous-integration.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,31 @@ jobs:
9898
brew services start memcached
9999
sleep 5
100100
101-
- name: Setup Redis (Windows)
101+
- name: Setup Redis and Memcached (Windows)
102102
if: runner.os == 'Windows'
103103
run: |
104-
choco install redis-64 -y
105-
# Redis をサービスとして起動
106-
redis-server --service-install --service-name Redis
107-
net start Redis
104+
# インストール
105+
choco install redis-64 memcached -y
106+
107+
# 環境変数を更新
108+
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
109+
110+
# Redis を直接起動(サービス化せずに)
111+
Start-Process -FilePath "redis-server" -WindowStyle Hidden -ErrorAction SilentlyContinue
112+
if ($LASTEXITCODE -ne 0) {
113+
# パスが通っていない場合、直接パス指定
114+
Start-Process -FilePath "C:\ProgramData\chocolatey\lib\redis-64\tools\redis-server.exe" -WindowStyle Hidden
115+
}
116+
117+
# Memcached を直接起動
118+
Start-Process -FilePath "memcached" -ArgumentList "-m 64" -WindowStyle Hidden -ErrorAction SilentlyContinue
119+
if ($LASTEXITCODE -ne 0) {
120+
Start-Process -FilePath "C:\ProgramData\chocolatey\lib\memcached\tools\memcached.exe" -ArgumentList "-m 64" -WindowStyle Hidden
121+
}
122+
123+
# 起動確認
108124
Start-Sleep 5
109-
redis-cli ping
110-
111-
- name: Install Memcached (Windows)
112-
if: runner.os == 'Windows'
113-
run: |
114-
choco install memcached -y
115-
# Memcached をサービスとして起動
116-
net start memcached
117-
Start-Sleep 3
125+
redis-cli ping 2>$null || & "C:\ProgramData\chocolatey\lib\redis-64\tools\redis-cli.exe" ping
118126
netstat -an | findstr "11211"
119127
120128
- name: Setup PHP ${{ matrix.php-version }}

0 commit comments

Comments
 (0)