Skip to content

Merge pull request #313 from iory/bump #21

Merge pull request #313 from iory/bump

Merge pull request #313 from iory/bump #21

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
formatting:
name: Check Formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Formatting
run: |
python -m pip install --upgrade pip
pip install hacking isort
- name: Check Formatting
run: |
flake8 .
grep -rlIP '[^\x00-\x7F]' skrobot | grep '\.pyx\?' | sort > unicode.out; grep -rlI '# -\*- coding: \(utf-8\|latin-1\) -\*-' skrobot | grep '\.pyx\?' | sort > coding.out; comm -23 unicode.out coding.out > test_code.out; cat test_code.out; test \! -s test_code.out
- name: Check isort
run: |
isort -c .
requirements-formatting:
name: Check Requirements Formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Check Formatting
run: |
sort -C requirements.txt
tests-3x:
name: Run Unit Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6.15, 3.8.16, 3.10.10]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install APT On Linux
run: |
sudo apt-get update -qq -y
sudo apt-get install -qq -y libspatialindex-dev freeglut3-dev libsuitesparse-dev libblas-dev liblapack-dev
- name: Install Pytest
run: |
python -m pip install --upgrade pip setuptools wheel
pip install Cython
pip install pytest hacking
- name: Install scikit-robot
run: pip install .[all]
- name: Run Pytest
run: pytest -v tests
tests-2x:
name: Run Unit Tests
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
steps:
- uses: actions/checkout@v3
- name: Install APT On Linux
run: |
apt-get update && apt-get install sudo cmake -y
sudo apt-get update -qq -y
sudo apt-get install -qq -y libspatialindex-dev freeglut3-dev libsuitesparse-dev libblas-dev liblapack-dev
- name: Install Pytest
run: |
python -m pip install --upgrade pip setuptools wheel
pip install Cython
pip install pytest hacking
- name: Install scikit-robot
run: pip install .[all]
- name: Run Pytest
run: sudo pytest -v tests # require sudo to access /tmp dir
pypi:
name: Release To PyPi
needs: [formatting, requirements-formatting, tests-2x, tests-3x]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
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
twine upload dist/*