Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion actions/persistent-stores/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,28 @@ runs:
# https://github.com/hashicorp/consul/issues/22822 so we need to run
# 1.20.1 until they fix the issue
run: |
choco install consul --version=1.20.1
# The chocolatey package would otherwise register Consul as a Windows
# service which races with the dev agent for port binding. /noservice
# skips that registration so only the dev agent runs.
choco install consul --version=1.20.1 --params="'/noservice'"

Start-Process consul -ArgumentList 'agent', '-dev', '-http-port=${{ inputs.consul_port }}'

# consul members exits non-zero until the agent's HTTP API responds.
# In dev mode the leader is self-elected immediately on startup, so
# this is purely a process-readiness check.
$deadline = (Get-Date).AddSeconds(30)
$ready = $false
while ((Get-Date) -lt $deadline) {
consul members -http-addr="http://127.0.0.1:${{ inputs.consul_port }}" 2>&1 | Out-Null
if ($LASTEXITCODE -eq 0) { $ready = $true; break }
Start-Sleep -Seconds 1
}
if (-not $ready) {
Write-Error "Consul did not become ready within 30 seconds"
exit 1
}

- name: "DynamoDB for Windows"
shell: powershell
if: ${{ inputs.dynamodb == 'true' && runner.os == 'Windows' }}
Expand Down