Skip to content

Commit

Permalink
Verify Wheel Build and SDist Test in PR Tests Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lapp0 committed Jun 1, 2024
1 parent 3a7d83b commit d10ae49
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 25 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Wheel

on:
workflow_call:

jobs:
build-and-test:
name: Test SDist and Build Wheel
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Build sdist and wheel
run: |
python -m pip install -U pip
python -m pip install build
python -m build
- name: Check sdist install and imports
run: |
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/outlines-*.tar.gz
venv-sdist/bin/python -c "import outlines"
- name: Check wheel install and imports
run: |
mkdir -p test-wheel
cd test-wheel
python -m venv venv-wheel
venv-wheel/bin/python -m pip install ../dist/outlines-*.whl
venv-wheel/bin/python -c "import outlines"
26 changes: 1 addition & 25 deletions .github/workflows/release_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,10 @@ jobs:
name: Build and publish on PyPi
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Build sdist and wheel
run: |
python -m pip install -U pip
python -m pip install build
python -m build
- uses: .github/workflows/build_wheel.yml
- name: Check that the package version matches the Release name
run: |
grep -Rq "^Version: ${GITHUB_REF:10}$" outlines.egg-info/PKG-INFO
- name: Check sdist install and imports
run: |
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/outlines-*.tar.gz
venv-sdist/bin/python -c "import outlines"
- name: Check wheel install and imports
run: |
mkdir -p test-wheel
cd test-wheel
python -m venv venv-wheel
venv-wheel/bin/python -m pip install ../dist/outlines-*.whl
venv-wheel/bin/python -c "import outlines"
- name: Publish to PyPi
uses: pypa/[email protected]
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ jobs:
name: html-report
path: htmlcov
if: ${{ failure() }}

build-wheel:
uses: ./.github/workflows/build_wheel.yml

0 comments on commit d10ae49

Please sign in to comment.