Responsive redesign #266
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- "*" | |
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 }} | |
strategy: | |
matrix: | |
include: | |
- label: CI-old | |
os: ubuntu-latest | |
python-version: 3.8 | |
extra_dependencies: "rdkit==2020.03.1 boost-cpp=1.72.0=h359cf19_6" | |
- label: CI-edge | |
os: ubuntu-latest | |
python-version: "3.10" | |
extra_dependencies: "rdkit" | |
- label: CI-py3.8-rdkit2022 | |
os: ubuntu-latest | |
python-version: 3.8 | |
extra_dependencies: "rdkit==2022.03.1" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "12.x" | |
cache: "npm" | |
- name: Install Firefox | |
uses: browser-actions/setup-firefox@latest | |
- run: firefox --version | |
- name: Prepare Selenium | |
uses: browser-actions/setup-geckodriver@latest | |
with: | |
geckodriver-version: "0.32.0" | |
- run: geckodriver --version | |
- name: Cache conda | |
uses: actions/cache@v3 | |
env: | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
conda-${{ hashFiles('environment.yml') }}-${{ matrix.label }}-${{ env.CACHE_NUMBER }} | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: pip-${{ hashFiles('setup.cfg') }} | |
restore-keys: pip- | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
environment-file: environment.yml | |
use-only-tar-bz2: true | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
- name: Check conda and pip | |
run: | | |
which python | |
python --version | |
pip --version | |
conda --version | |
mamba --version | |
- name: Install remaining conda dependencies | |
run: | | |
mamba install ${{ matrix.extra_dependencies }} | |
mamba list | |
- name: Install package through pip | |
run: | | |
pip install .[tests,build] | |
pip list | |
- name: Run tests | |
run: | | |
pytest --color=yes --disable-pytest-warnings \ | |
--cov=mols2grid --cov-report=xml \ | |
tests/ -m "not webdriver" | |
- name: Run webdriver tests | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_seconds: 340 | |
max_attempts: 5 | |
retry_on: timeout | |
shell: bash | |
command: | | |
source /usr/share/miniconda/etc/profile.d/conda.sh | |
conda activate /usr/share/miniconda3/envs/test | |
pytest --color=yes --disable-pytest-warnings \ | |
--cov=mols2grid --cov-report=xml --cov-append \ | |
tests/ -m "webdriver" | |
- name: Measure tests coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage.xml | |
fail_ci_if_error: true | |
verbose: true | |
- name: Prepare for build | |
run: | | |
pip uninstall -y mols2grid | |
python -m build . | |
echo "$SCRIPT" > test_install.py | |
cat test_install.py | |
env: | |
SCRIPT: | | |
import mols2grid as mg | |
from rdkit import RDConfig | |
sdf = f"{RDConfig.RDDocsDir}/Book/data/solubility.test.sdf" | |
mg.save(sdf, output="/dev/null") | |
- name: Test tar.gz build | |
run: | | |
pip install dist/mols2grid-*.tar.gz | |
python test_install.py | |
pip uninstall -y mols2grid | |
- name: Test wheel build | |
run: | | |
pip install dist/mols2grid-*.whl | |
python test_install.py |