Skip to content

Commit 6bb8921

Browse files
committed
Add test-sdist and test-wheel steps
1 parent 19a58bc commit 6bb8921

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ Helper actions for Python projects
1010
| [run-cibuildwheel](./run-cibuildwheel) | `actions-ext/python/run-cibuildwheel` | Run [`cibuildwheel`](https://cibuildwheel.readthedocs.io/en/stable/) |
1111
| [upload-dist](./upload-dist) | `actions-ext/python/upload-dist` | Upload a python sdist or wheel |
1212
| [download-dist](./download-dist) | `actions-ext/python/download-dist` | Download and install a python sdist or wheel |
13+
| [test-wheel](./test-wheel) | `actions-ext/python/test-wheel` | Install a wheel in a fresh venv and verify module import |
14+
| [test-sdist](./test-sdist) | `actions-ext/python/test-sdist` | Install an sdist in a fresh venv and verify module import |

test-sdist/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Test Sdist Install
2+
description: 'Install an sdist from dist/ in a fresh venv and verify a module can be imported'
3+
4+
inputs:
5+
module:
6+
description: "Python module name to test importing"
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Test sdist install
13+
shell: bash
14+
run: |
15+
python -m venv .test-sdist
16+
VENV_BIN=".test-sdist/bin"; [ -d ".test-sdist/Scripts" ] && VENV_BIN=".test-sdist/Scripts"
17+
"$VENV_BIN/pip" install dist/*.tar.gz
18+
"$VENV_BIN/python" -c "import ${{ inputs.module }}"

test-wheel/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Test Wheel Install
2+
description: 'Install a wheel from dist/ in a fresh venv and verify a module can be imported'
3+
4+
inputs:
5+
module:
6+
description: "Python module name to test importing"
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Test wheel install
13+
shell: bash
14+
run: |
15+
python -m venv .test-wheel
16+
VENV_BIN=".test-wheel/bin"; [ -d ".test-wheel/Scripts" ] && VENV_BIN=".test-wheel/Scripts"
17+
"$VENV_BIN/pip" install dist/*.whl
18+
"$VENV_BIN/python" -c "import ${{ inputs.module }}"

0 commit comments

Comments
 (0)