From eff25f776adf799d2e69b4f0a3317865ed0a7292 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sat, 17 Feb 2024 16:28:34 -0500 Subject: [PATCH] ci: Update "cd" workflow adding "test_sdist" and "check_dist" jobs Adapted from https://github.com/scikit-build/cmake-python-distributions --- ...ter.__type=='compiled' %}cd.yml{% endif %} | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/{% if cookiecutter.__type=='compiled' %}cd.yml{% endif %} b/{{cookiecutter.project_name}}/.github/workflows/{% if cookiecutter.__type=='compiled' %}cd.yml{% endif %} index 5124675e..f034a450 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/{% if cookiecutter.__type=='compiled' %}cd.yml{% endif %} +++ b/{{cookiecutter.project_name}}/.github/workflows/{% if cookiecutter.__type=='compiled' %}cd.yml{% endif %} @@ -30,6 +30,51 @@ jobs: name: cibw-sdist path: dist/*.tar.gz + test_sdist: + name: Test SDist with python ${{ matrix.python }} + needs: [make_sdist] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ["3.8", "3.12"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + name: Install Python ${{ matrix.python }} + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies + run: | + pip install pytest pytest-cov + + - uses: actions/download-artifact@v4 + with: + name: cibw-sdist + path: dist + + - name: Install SDist + run: | + pip -V + pip install dist/*.tar.gz + rm -rf dist + + - name: Test installed SDist + run: pytest ./tests + + check_dist: + name: Check dist + needs: [build_wheels, make_sdist, test_sdist] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + path: all + + - run: pipx run twine check --strict all/*/* + build_wheels: name: {% raw %}Wheel on ${{ matrix.os }}{% endraw %} runs-on: {% raw %}${{ matrix.os }}{% endraw %} @@ -52,7 +97,7 @@ jobs: path: wheelhouse/*.whl upload_all: - needs: [build_wheels, make_sdist] + needs: [check_dist] environment: pypi permissions: id-token: write