Skip to content

Commit 6836d26

Browse files
jdetterbfops
andauthored
CI - Fail properly if psql failed to install (#4399)
# Description of Changes We had an issue where the install failed but did not fail the step: ``` Run choco install psql -y --no-progress Chocolatey v2.6.0 Installing the following packages: psql By installing, you accept licenses for the packages. Failed to fetch results from V2 feed at 'https://community.chocolatey.org/api/v2/Packages(Id='psql',Version='16.2.0')' with following message : Response status code does not indicate success: 504 (Gateway Time-out). Need to add specific handling for exception type NuGetResolverInputException Unable to find package 'psql'. Existing packages must be restored before performing an install or update. ``` # API and ABI breaking changes <!-- If this is an API or ABI breaking change, please apply the corresponding GitHub label. --> None - this is just CI # Expected complexity level and risk None - this is just CI <!-- How complicated do you think these changes are? Grade on a scale from 1 to 5, where 1 is a trivial change, and 5 is a deep-reaching and complex change. This complexity rating applies not only to the complexity apparent in the diff, but also to its interactions with existing and future code. If you answered more than a 2, explain what is complex about the PR, and what other components it interacts with in potentially concerning ways. --> # Testing <!-- Describe any testing you've done, and any testing you'd like your reviewers to do, so that you're confident that all the changes work as expected! --> - [x] Windows smoketests are able to use `psql` properly --------- Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com> Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com> Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
1 parent 6298e0a commit 6836d26

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,15 @@ jobs:
101101
102102
- name: Install psql (Windows)
103103
if: runner.os == 'Windows'
104-
run: choco install psql -y --no-progress
105-
shell: powershell
104+
shell: pwsh
105+
run: |
106+
# Fail properly if any individual command fails
107+
$ErrorActionPreference = 'Stop'
108+
$PSNativeCommandUseErrorActionPreference = $true
109+
choco install psql -y --no-progress
110+
# Check for existence, since `choco` doesn't seem to fail the step if it fails to install..
111+
# See https://github.com/clockworklabs/SpacetimeDB/pull/4399 for more background.
112+
Get-Command psql
106113
107114
- name: Update dotnet workloads
108115
if: runner.os == 'Windows'

0 commit comments

Comments
 (0)