|
36 | 36 | target |
37 | 37 | key: ${{ runner.os }}-cargo-${{ matrix.rust-version }}-${{ hashFiles('**/Cargo.lock') }} |
38 | 38 |
|
| 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 | +
|
39 | 50 | - name: Install maturin |
40 | 51 | run: pip install maturin |
41 | 52 |
|
|
82 | 93 | - name: Build wheel |
83 | 94 | run: maturin build --release |
84 | 95 |
|
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 |
86 | 122 | 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