Skip to content

Commit afa598c

Browse files
committed
fix smoke_test
1 parent af39408 commit afa598c

File tree

1 file changed

+45
-31
lines changed

1 file changed

+45
-31
lines changed

.github/workflows/build_wheel_on_windows.yml

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ jobs:
5656
build_wheels_windows_2025:
5757
name: Build wheels on windows-2025 (x64)
5858
runs-on: windows-g9i
59+
outputs:
60+
zvec_version: ${{ steps.log_vars.outputs.zvec_version }}
5961

6062
steps:
6163
- name: Show env info
@@ -84,54 +86,55 @@ jobs:
8486
pip install --upgrade pip
8587
pip install cibuildwheel==3.4.0
8688
87-
- name: Add Git bin to PATH
88-
run: echo "C:\Program Files\Git\usr\bin" >> $GITHUB_PATH
89-
shell: powershell
89+
# - name: Add Git bin to PATH
90+
# run: echo "C:\Program Files\Git\usr\bin" >> $GITHUB_PATH
91+
# shell: powershell
9092

91-
# Cache the directory where cibuildwheel outputs the .whl files
9293
- name: Cache built wheels
9394
id: cache-wheels
9495
uses: actions/cache@v4
9596
with:
9697
path: wheelhouse
97-
# IMPORTANT: Update these file extensions/paths to match the source files
98-
# that actually affect your compiled wheel (e.g., .c, .cpp, .rs, .py)
9998
key: ${{ runner.os }}-wheels-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/*.py', '**/*.c', '**/*.cpp') }}
10099

101100
- name: Build wheels using cibuildwheel
102101
if: steps.cache-wheels.outputs.cache-hit != 'true'
103102
shell: powershell
104103
run: |
105104
python -m cibuildwheel --output-dir wheelhouse
106-
107-
# - name: Install and test wheel
108-
# shell: powershell
109-
# run: |
110-
# # cp11
111-
# $wheels = Get-ChildItem wheelhouse/*.whl | Select-Object -First 2
112-
# $wheelPath = $wheels.FullName
113-
#
114-
# python -m venv test_env
115-
# $venvPython = "test_env/Scripts/python.exe"
116-
# & $venvPython -m pip install --upgrade pip
117-
# & $venvPython -m pip install $wheelPath
118-
# & $venvPython -c "import zvec; print('Import OK:', zvec.__version__)"
119-
105+
106+
- name: Install and test wheel
107+
shell: powershell
108+
run: |
109+
$wheels = (Get-ChildItem wheelhouse/zvec-*.whl)[1] # cp311
110+
$wheelPath = $wheels.FullName
111+
112+
python -m venv test_env
113+
$venvPython = "test_env/Scripts/python.exe"
114+
& $venvPython -m pip install --upgrade pip
115+
& $venvPython -m pip install $wheelPath
116+
& $venvPython -c "import zvec; print('Import OK:', zvec.__version__)"
117+
120118
- name: Log wheel variables
119+
id: log_vars
121120
shell: powershell
122121
run: |
123122
$wheels = Get-ChildItem wheelhouse/*.whl | Select-Object -ExpandProperty FullName
124123
125-
if ($env:GITHUB_STEP_SUMMARY) {
126-
$wheels | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
127-
}
124+
# Extract zvec version from wheel filename
125+
$wheel = Get-ChildItem wheelhouse/zvec-*.whl | Select-Object -First 1
126+
$filename = $wheel.Name
127+
$version = [regex]::Match($filename, '^zvec-([^-]+)-').Groups[1].Value
128128
129-
"wheels=$($wheels -join ' ')" | Out-File -FilePath $env:GITHUB_ENV -Append
129+
Write-Host "Detected zvec version: $version"
130130
131-
$wheels = Get-ChildItem wheelhouse/*.whl | Select-Object -ExpandProperty FullName
131+
# Output version for job outputs
132+
"zvec_version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
132133
133134
if ($env:GITHUB_STEP_SUMMARY) {
135+
"Wheel files:" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
134136
$wheels | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
137+
"zvec version: $version" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
135138
}
136139
137140
"wheels=$($wheels -join ' ')" | Out-File -FilePath $env:GITHUB_ENV -Append
@@ -163,23 +166,34 @@ jobs:
163166
twine upload --skip-existing --verbose wheelhouse/*.whl
164167
165168
smoke_test:
166-
needs: [ publish_wheels, compute_matrix ]
169+
needs: [ publish_wheels, compute_matrix, build_wheels_windows_2025 ]
167170
strategy:
168171
fail-fast: false
169172
max-parallel: 4
170173
matrix: ${{ fromJson(needs.compute_matrix.outputs.matrix) }}
171174
runs-on: ${{ matrix.platform }}
172175

173-
174176
steps:
177+
# - name: Download built wheels
178+
# uses: actions/download-artifact@v4
179+
# with:
180+
# name: windows-wheels
181+
# path: wheelhouse/
182+
175183
- name: Smoke test from PyPI
176184
shell: powershell
177185
env:
178186
PUBLISH_TARGET: ${{ inputs.publish_target || 'testpypi' }}
187+
ZVEC_VERSION: ${{ needs.build_wheels_windows_2025.outputs.zvec_version }}
179188
run: |
180-
$wheel = (Get-ChildItem wheelhouse/zvec-*.whl)[1] # cp311
181-
$filename = $wheel.Name
182-
$version = [regex]::Match($filename, '^zvec-([^-]+)-').Groups[1].Value
189+
# Check if version is empty
190+
if ([string]::IsNullOrWhiteSpace($env:ZVEC_VERSION)) {
191+
Write-Host "ERROR: ZVEC_VERSION is empty or not set. Cannot proceed with smoke test."
192+
exit 1
193+
}
194+
195+
$version = $env:ZVEC_VERSION
196+
Write-Host "Using zvec version from build job: $version"
183197
184198
if ($env:PUBLISH_TARGET -eq 'testpypi') {
185199
$indexArgs = @("--index-url", "https://test.pypi.org/simple/", "--extra-index-url", "https://pypi.org/simple/")
@@ -212,4 +226,4 @@ jobs:
212226
$venvPython = "test_env/Scripts/python.exe"
213227
& $venvPython -m pip install --upgrade pip
214228
& $venvPython -m pip install @indexArgs "zvec==$version"
215-
& $venvPython -c "import zvec; print('Import OK:', zvec.__version__)"
229+
& $venvPython -c "import zvec; print('Import OK:', zvec.__version__)"

0 commit comments

Comments
 (0)