From ba2a03658edf756aa6aa4fcdbccb765a536ce256 Mon Sep 17 00:00:00 2001 From: davhofer Date: Tue, 20 Aug 2024 12:26:49 +0200 Subject: [PATCH] test: add installation test for simple scikit-build-core package --- .github/workflows/run-installation-tests.yaml | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-installation-tests.yaml b/.github/workflows/run-installation-tests.yaml index d87c920..c3c8fd5 100644 --- a/.github/workflows/run-installation-tests.yaml +++ b/.github/workflows/run-installation-tests.yaml @@ -6,7 +6,7 @@ jobs: test: runs-on: ubuntu-latest container: - image: davhofer/py2spack-spack-installation-test:latest + image: davhofer/py2spack-spack-installation-test:latest steps: - name: Checkout code @@ -22,7 +22,7 @@ jobs: run: echo $SPACK_ROOT # Test tqdm installation - - name: Remove tqdm + - name: Remove tqdm run: | rm -rd $SPACK_PKGS/py-tqdm || true @@ -40,7 +40,7 @@ jobs: if: success() # Test pygments installation - - name: Remove pygments and dependency colorama + - name: Remove pygments and dependency colorama run: | rm -rd $SPACK_PKGS/py-pygments || true rm -rd $SPACK_PKGS/py-colorama || true @@ -59,7 +59,7 @@ jobs: if: success() # Test flask installation - - name: Remove flask and dependency jinja2 + - name: Remove flask and dependency jinja2 run: | rm -rd $SPACK_PKGS/py-flask || true rm -rd $SPACK_PKGS/py-jinja2 || true @@ -77,3 +77,16 @@ jobs: run: echo "flask import succeeded" if: success() + # Test sbc-example installation (scikit-build-core python extension) + - name: Run py2spack conversion + run: py2spack --versions-per-package 5 --max-conversions 1 https://github.com/davhofer/sbc-example + + - name: Install py-sbc-example with Spack + run: $SPACK_ROOT/bin/spack install py-sbc-example + + - name: Load py-sbc-example with Spack and test import + run: cd $SPACK_ROOT && . share/spack/setup-env.sh && spack load py-sbc-example && python -c 'import example; example.square(4);' + + - name: Check if import of scikit-build-core example package was successfull + run: echo "import of scikit-build-core example package succeeded" + if: success()