Tutorials overhaul #415
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
name: tests | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -l {0} | |
concurrency: | |
group: "${{ github.ref }}-${{ github.head_ref }}" | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: ${{ matrix.label }} | |
runs-on: ${{ matrix.os }} | |
# only run once if internal PR | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
include: | |
- label: earliest | |
os: ubuntu-latest | |
python-version: 3.8 | |
rdkit-version: "rdkit=2021.03.1" | |
coverage: false | |
- label: baseline | |
os: ubuntu-latest | |
python-version: 3.9 | |
rdkit-version: "rdkit~=2022.09" | |
coverage: true | |
- label: latest | |
os: ubuntu-latest | |
python-version: "3.10" | |
rdkit-version: "rdkit" | |
coverage: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
auto-update-conda: true | |
channel-priority: flexible | |
channels: conda-forge, defaults | |
add-pip-as-python-dependency: true | |
architecture: x64 | |
use-mamba: true | |
miniforge-variant: Mambaforge | |
- name: Check conda and pip | |
run: | | |
which python | |
python --version | |
pip --version | |
conda --version | |
mamba --version | |
- name: Install conda dependencies | |
run: | | |
mamba install ${{ matrix.rdkit-version }} | |
mamba list | |
- name: Install package through pip | |
run: | | |
pip install .[dev] | |
pip list | |
- name: Run tests | |
run: | | |
pytest --color=yes --disable-pytest-warnings --cov=prolif --cov-report=xml tests/ | |
- name: Measure tests coverage | |
if: matrix.coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Build | |
run: | | |
python -m build | |
- name: Remove previous ProLIF install | |
run: | | |
pip uninstall -y prolif | |
- name: Install from tar.gz | |
run: | | |
pip install dist/prolif-*.tar.gz | |
- name: Test tar.gz install | |
run: | | |
python <<EOF | |
import prolif | |
import os | |
print(prolif.__version__) | |
from prolif.plotting.network import LigNetwork | |
assert os.path.isfile(prolif.datafiles.TOP) | |
EOF | |
- name: Remove previous ProLIF install | |
run: | | |
pip uninstall -y prolif | |
- name: Install from wheel | |
run: | | |
pip install dist/prolif-*.whl | |
- name: Test wheel install | |
run: | | |
python <<EOF | |
import prolif | |
import os | |
print(prolif.__version__) | |
from prolif.plotting.network import LigNetwork | |
assert os.path.isfile(prolif.datafiles.TOP) | |
EOF |