Bump version: 1.4.0 → 1.5.0 #2
Workflow file for this run
This file contains hidden or 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 | |
| env: | |
| PACKAGE: webgeocalc | |
| PYTHON: 3.11 | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+' | |
| jobs: | |
| flake8: | |
| name: Linter - flake8 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.PYTHON }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ env.PYTHON }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flake8 flake8-colors flake8-docstrings flake8-import-order pep8-naming mccabe | |
| - name: Run flake8 | |
| run: flake8 setup.py docs/conf.py $PACKAGE/ tests/ | |
| pylint: | |
| name: Linter - Pylint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.PYTHON }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ env.PYTHON }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . pylint pytest | |
| - name: Run pylint | |
| run: pylint $PACKAGE/ tests/*.py | |
| bandit: | |
| name: Linter - Bandit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.PYTHON }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ env.PYTHON }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install bandit | |
| - name: Run bandit | |
| run: | | |
| bandit -r $PACKAGE | |
| bandit -r tests --skip B101 | |
| tests: | |
| name: Unit tests, coverage and notebooks | |
| needs: [flake8, pylint] | |
| runs-on: ubuntu-latest | |
| env: | |
| PYTEST_ADDOPTS: --color=yes | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.PYTHON }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ env.PYTHON }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest requests_mock pytest-cov codecov nbval | |
| - name: Run unit-tests with coverage | |
| run: pytest --cov=$PACKAGE tests/ | |
| - name: Push coverage to codecov | |
| run: codecov | |
| - name: Run jupyter notebook tests | |
| run: pytest --nbval-lax examples/ | |
| docs: | |
| name: Docs | |
| needs: [flake8, pylint] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . -r docs/requirements.txt | |
| - name: Build docs | |
| run: sphinx-build docs docs/_build --color -W -bhtml | |
| - name: Run doctests in docstrings | |
| run: sphinx-build docs docs/_build --color -W -bdoctest | |
| pypi: | |
| name: Deploy to PyPI | |
| if: contains(github.ref, 'refs/tags/') | |
| needs: [flake8, pylint, bandit, tests, docs] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Set up Python ${{ env.PYTHON }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ env.PYTHON }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install setuptools wheel twine | |
| - name: Build package | |
| run: python setup.py sdist bdist_wheel | |
| - name: Publish to PyPI | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| run: twine upload $PYPI_REPO dist/* | |
| release: | |
| name: Release to Github | |
| needs: pypi | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Create Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} |