Fix import order #47
Workflow file for this run
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
on: push | |
name: Continuous Integration | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Compile | |
run: | | |
sudo apt install libboost-filesystem-dev libboost-system-dev | |
pip install --upgrade pip | |
git submodule update --init | |
pip install -e . | |
- name: Tests | |
run: | | |
pip install pytest pytest-cov | |
pytest tests -r a --cov=pyhector --cov-report='' | |
- name: Linters | |
run: | | |
pip install flake8 pylint | |
flake8 pyhector tests setup.py | |
pylint --fail-under=9.5 pyhector | |
- name: Formatting | |
run: | | |
pip install black isort | |
black --check pyhector tests setup.py --exclude pyhector/_version.py | |
isort --check-only --quiet --recursive pyhector tests setup.py | |
- name: Documentation | |
run: | | |
pip install sphinx>=1.8 sphinx_rtd_theme | |
sphinx-build -M html docs docs/build -qW | |
sphinx-build -M html docs docs/build -Eqn -b coverage | |
if [[ -s docs/build/html/python.txt ]] | |
then | |
echo | |
echo "Error: Documentation missing:" | |
echo | |
cat docs/build/html/python.txt | |
exit 1 | |
fi | |
- name: Coverage | |
env: | |
MIN_COVERAGE: "75" | |
run: | | |
pip install coverage | |
if ! coverage report --fail-under="$MIN_COVERAGE" --show-missing | |
then | |
echo | |
echo "Error: Test coverage has to be at least ${MIN_COVERAGE}%" | |
exit 1 | |
fi | |
deploy-pypi: | |
needs: test | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Create source distribution | |
run: | | |
python setup.py sdist | |
- name: Publish package to PyPI | |
# pypi-publish releases: | |
# https://github.com/pypa/gh-action-pypi-publish/releases | |
uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |