-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conformant wheel building and testing. (#31)
* CI testing and limited ABI wheels. * Bump osx deployment target. * Change osx arch config. * Fix runner version. * Try fix arch.
- Loading branch information
Showing
4 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,60 @@ | ||
name: Wheel | ||
name: Wheel and Test | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.config.os }} | ||
name: Build on ${{ matrix.config.os }} | ||
name: Build ${{ matrix.config.os }}-${{ matrix.config.arch }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: "ubuntu-20.04", build-dir: "build-linux" } | ||
- { os: "windows-2019", build-dir: "build-windows" } | ||
- { os: "macos-11", build-dir: "build-macos" } | ||
- { os: "ubuntu-20.04", arch: "auto64" } | ||
- { os: "windows-2019", arch: "auto64" } | ||
- { os: "macos-11", arch: "auto64" } | ||
- { os: "macos-11", arch: "universal2" } | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: "true" | ||
- name: Install Dependencies | ||
run: | | ||
python3 -m pip install wheel | ||
- name: Wheel | ||
run: | | ||
python3 setup.py bdist_wheel | ||
- name: Build Wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS: ${{ matrix.config.arch }} | ||
CIBW_BUILD: cp36-* cp38-macosx_universal2 | ||
MACOSX_DEPLOYMENT_TARGET: "10.14" | ||
- name: List Build Results | ||
run: | | ||
ls dist | ||
ls wheelhouse | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.config.os }}-build-wheel | ||
path: ./dist/*.whl | ||
name: wheels | ||
path: ./wheelhouse/*.whl | ||
run: | ||
name: Test on ${{ matrix.os }} with python ${{ matrix.python-version }} | ||
needs: [build] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
python-version: ['3.6', '3.11'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: wheels | ||
path: built_wheels | ||
- name: Install Dependencies | ||
run: python -m pip install trimesh numpy | ||
- name: Install Packages | ||
run: python -m pip install --no-index --find-links=./built_wheels coacd | ||
- name: Run Tests | ||
run: python run_tests.py -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import trimesh | ||
import os | ||
import glob | ||
import coacd | ||
import unittest | ||
|
||
|
||
class TestExamples(unittest.TestCase): | ||
@staticmethod | ||
def single(input_file): | ||
|
||
def _test(self: 'TestExamples'): | ||
coacd.set_log_level("warn") | ||
mesh = trimesh.load(input_file, force="mesh") | ||
mesh = coacd.Mesh(mesh.vertices, mesh.faces) | ||
self.assertLessEqual(len(coacd.run_coacd(mesh)), 1000) | ||
|
||
return _test | ||
|
||
|
||
for f in glob.glob("examples/*.obj"): | ||
setattr(TestExamples, f'test_{os.path.splitext(os.path.basename(f))[0].lower()}', TestExamples.single(f)) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters