Merge pull request #635 from marrink-lab/martinize2_tutorials #619
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: test package | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
VERMOUTH_TEST_DSSP: mkdssp | |
SKIP_GENERATE_AUTHORS: 1 | |
SKIP_WRITE_GIT_CHANGELOG: 1 | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
py_version: ["3.9", "3.10", "3.11", "3.12"] | |
include: | |
- py_version: "3.9" | |
WITH_CODECOV: true | |
- py_version: "3.10" | |
WITH_CODECOV: true | |
- py_version: "3.11" | |
WITH_CODECOV: true | |
- py_version: "3.12" | |
WITH_CODECOV: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.py_version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.py_version }} | |
cache: pip | |
cache-dependency-path: | | |
**/setup.cfg | |
**/requirements-*.txt | |
**/pyproject.toml | |
- name: Install dependencies part I | |
run: | | |
sudo apt-get install dssp | |
pip install --upgrade setuptools pip | |
- name: Install package and requirements | |
run: | | |
pip install --upgrade . | |
pip install -r requirements-tests.txt | |
- name: Run pytest with codecoverage | |
run: | | |
coverage run $(which pytest) -vv --hypothesis-show-statistics | |
coverage report | |
coverage xml | |
- if: ${{ matrix.WITH_CODECOV }} | |
name: Upload coverage codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: pip | |
cache-dependency-path: | | |
**/setup.cfg | |
**/requirements-*.txt | |
**/pyproject.toml | |
- name: Install dependencies | |
run: | | |
pip install --upgrade setuptools pip | |
pip install --upgrade . | |
pip install -r requirements-tests.txt | |
- name: Run pylint | |
run: | | |
pylint --disable=fixme --fail-under=8.0 vermouth | |
pylint --disable=fixme --fail-under=9.0 bin/martinize2 | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
cache: pip | |
cache-dependency-path: | | |
**/setup.cfg | |
**/requirements-*.txt | |
**/pyproject.toml | |
- name: Install dependencies | |
run: | | |
pip install --upgrade setuptools pip | |
pip install --upgrade . | |
pip install -r requirements-docs.txt | |
- name: Run docs | |
run: | | |
mkdir -p doc/source/_static | |
sphinx-build -EnW -b html doc/source/ doc/build/html | |
deploy: | |
needs: [build, lint, docs] | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/vermouth | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: Set up Python 3 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
cache: pip | |
cache-dependency-path: | | |
**/setup.cfg | |
**/requirements-*.txt | |
**/pyproject.toml | |
- name: Install dependencies | |
run: | | |
pip install --upgrade setuptools pip | |
pip install --upgrade . | |
- name: Install pypa/build | |
run: | | |
python3 -m pip install build pbr --user | |
- name: Build a binary wheel and a source tarball | |
run: python3 -m build --sdist --wheel --outdir dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |