Merge branch 'dev' #21
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
name: Release PySLM | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
formatting: | ||
name: Check Code Formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- name: Install Formatting | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install autopep8 flake8 | ||
- name: Check Formatting | ||
run: | | ||
flake8 tests | ||
flake8 trimesh | ||
flake8 examples | ||
flake8 setup.py | ||
autopep8 --recursive --aggressive --diff --exit-code pyslm/ | ||
autopep8 --recursive --aggressive --diff --exit-code examples/ | ||
tests: | ||
name: Run Unit Tests | ||
needs: formatting | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: [3.5, 3.6, 3.7, 3.8, 3.9] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
exclude: | ||
# Shapely as far as I can tell has no Windows/2.7 wheels | ||
- os: macos-latest | ||
python-version: 3.9 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install APT On Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update -qq -y | ||
sudo apt-get install -qq -y libgeos-dev | ||
- name: Install Brew On Mac | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
brew install geos | ||
- name: Install Pytest | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest pytest-cov wheel coveralls setuptools | ||
- name: Install Python | ||
run: pip install .[easy] | ||
- name: Run Pytest | ||
run: pytest --cov=trimesh tests/ | ||
pypi: | ||
name: Release To PyPi | ||
needs: [tests, containers] | ||
Check failure on line 69 in .github/workflows/release.yml GitHub Actions / Release PySLMInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' | ||
- name: Install publishing dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
release: | ||
name: Create GitHub Release | ||
needs: [tests, containers] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Tag Version | ||
id: set_tag | ||
run: | | ||
export VER=$(python -c "exec(open('pyslm/version.py','r').read());print(__version__)") | ||
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 |