Skip to content

Commit

Permalink
ci: Windows is throwing away the exit code of venv build script
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtseng committed Jan 6, 2025
1 parent ca3f001 commit 637bed5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ commands:
# Download and cache dependencies
- restore_cache:
keys:
- v12win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }}
- v13win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }}

- run:
name: install python
Expand All @@ -163,14 +163,20 @@ commands:

- run:
name: install dependencies
# Only create venv if it's not been restored from cache
command: if (-not (Test-Path venv)) { .\ci\build_and_activate_venv.ps1 -venv venv }
# Only create venv if it's not been restored from cache.
# Need to throw error explicitly on error or else {} will get rid of
# the exit code.
command: |
if (-not (Test-Path venv)) {
.\ci\build_and_activate_venv.ps1 -venv venv
if ($LASTEXITCODE -ne 0) { throw "Failed to create venv" }
}
shell: powershell.exe

- save_cache:
paths:
- .\venv
key: v12win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }}
key: v13win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }}

- run:
name: install imitation
Expand Down

0 comments on commit 637bed5

Please sign in to comment.