From 201d76cade1475aae80d3acdbb0ab26af5a7f013 Mon Sep 17 00:00:00 2001 From: Conor MacBride Date: Thu, 7 Apr 2022 18:09:45 +0100 Subject: [PATCH] Add pure Python verification step There must be only one wheel and it must be pure Python. --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5238cc3..ee4a8ef 100644 --- a/action.yml +++ b/action.yml @@ -66,7 +66,16 @@ runs: run: python -m build --wheel . if: ${{ inputs.pure_python_wheel == 'true' }} - # TODO: check that the resulting wheel is indeed pure Python + - name: Verify that one pure Python wheel was built + shell: bash + run: | + ls -1 dist/* + if [ $(ls -1 dist/*.whl 2>/dev/null | wc -l) != 1 ] || + [ $(ls -1 dist/*none-any.whl 2>/dev/null | wc -l) != 1 ]; then + echo "::error ::Build failed because package is not pure Python." + exit 1 + fi + if: ${{ inputs.pure_python_wheel == 'true' }} - name: Test pure Python wheel distribution shell: bash