Skip to content

Merge pull request #2257 from mikedh/tri/2d #304

Merge pull request #2257 from mikedh/tri/2d

Merge pull request #2257 from mikedh/tri/2d #304

Workflow file for this run

name: Release Trimesh
on:
push:
branches:
- main
- release-candidate
jobs:
formatting:
name: Check Code Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install Formatting
run: |
pip install ruff
- name: Check Formatting
run: ruff check .
tests:
name: Run Unit Tests
needs: formatting
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-13, windows-latest]
exclude:
# windows runners have gotten flaky
- os: windows-latest
python-version: 3.8
- os: windows-latest
python-version: 3.9
- os: macos-13
python-version: 3.9
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Test a minimal install
run: |
pip install --no-cache-dir .
python tests/test_minimal.py
- name: Install Trimesh
run: pip install --no-cache-dir .[easy,test]
- name: Run Pytest
run: pytest tests/
pypi:
name: Release To PyPi
needs: [tests, containers]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install publishing dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pyproject-build --outdir dist .
twine upload dist/*
containers:
name: Build Docker Images
runs-on: ubuntu-latest
steps:
- name: Log In to Docker Hub
run: echo ${{ secrets.DH_PASS }} | docker login --username mikedh --password-stdin
- name: Checkout trimesh
uses: actions/checkout@v3
- name: Build Images And Docs
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
make tests # build docker images and run unit tests
make publish-docker # push images to docker hub
make docs # build sphinx docs
- name: Deploy Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./html
force_orphan: true
- name: Logout of registries
if: always()
run: |
docker logout
corpus:
runs-on: ubuntu-latest
name: Check Corpus Loading
steps:
- uses: actions/checkout@v3
- name: Trimesh DiskCache
id: cache-resolvers
uses: actions/cache@v3
with:
path: ~/.trimesh-cache
key: trimesh-cache
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Trimesh
run: pip install .[easy,test]
- name: Run Corpus Check
run: python tests/corpus.py
release:
permissions:
contents: write # for actions/create-release
name: Create GitHub Release
needs: [tests, containers]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Tag Version
id: set_tag
run: |
export VER=$(python trimesh/version.py)
echo "::set-output name=tag_name::${VER}"
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.set_tag.outputs.tag_name }}
release_name: Release ${{ steps.set_tag.outputs.tag_name }}
draft: false
prerelease: false