Skip to content

Commit 05944be

Browse files
committed
fix: fixed ci errors
1 parent c034727 commit 05944be

1 file changed

Lines changed: 47 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ jobs:
3636
target
3737
key: ${{ runner.os }}-cargo-${{ matrix.rust-version }}-${{ hashFiles('**/Cargo.lock') }}
3838

39+
- name: Create and activate virtual environment
40+
run: |
41+
python -m venv .venv
42+
if [ "$RUNNER_OS" != "Windows" ]; then
43+
echo "VIRTUAL_ENV=$PWD/.venv" >> $GITHUB_ENV
44+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
45+
else
46+
echo "VIRTUAL_ENV=$PWD\.venv" >> $GITHUB_ENV
47+
echo "$PWD\.venv\Scripts" >> $GITHUB_PATH
48+
fi
49+
3950
- name: Install maturin
4051
run: pip install maturin
4152

@@ -82,7 +93,40 @@ jobs:
8293
- name: Build wheel
8394
run: maturin build --release
8495

85-
- name: Test wheel installation
96+
- name: List wheel files
97+
run: |
98+
echo "Looking for wheel files in target/wheels/"
99+
ls -la target/wheels/ || echo "target/wheels/ directory not found"
100+
find target -name "*.whl" -type f || echo "No .whl files found"
101+
102+
- name: Test wheel installation (Linux/macOS)
103+
if: runner.os != 'Windows'
104+
shell: bash
105+
run: |
106+
# Find and install the wheel file
107+
WHEEL_FILE=$(find target -name "*.whl" -type f | head -1)
108+
if [ -n "$WHEEL_FILE" ]; then
109+
echo "Installing wheel: $WHEEL_FILE"
110+
pip install "$WHEEL_FILE"
111+
python -c "import hashsig_py; print('Import successful')"
112+
else
113+
echo "No wheel file found"
114+
echo "Contents of target directory:"
115+
find target -type f || echo "target directory not found"
116+
exit 1
117+
fi
118+
119+
- name: Test wheel installation (Windows)
120+
if: runner.os == 'Windows'
121+
shell: cmd
86122
run: |
87-
pip install target/wheels/*.whl
88-
python -c "import hashsig_py; print('Import successful')"
123+
for /r target %%i in (*.whl) do (
124+
echo Installing wheel: %%i
125+
pip install "%%i"
126+
python -c "import hashsig_py; print('Import successful')"
127+
goto :success
128+
)
129+
echo No wheel file found
130+
dir target /s
131+
exit /b 1
132+
:success

0 commit comments

Comments
 (0)