Skip to content

ci: add test for pypi exposed code (#30) #17

ci: add test for pypi exposed code (#30)

ci: add test for pypi exposed code (#30) #17

Workflow file for this run

---
name: build
on: [push]
jobs:
conda-tests:
name: Test with conda (${{ matrix.os }})
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
pip_cache_path: ~/.cache/pip
experimental: false
defaults:
run:
shell: bash -l {0} # For conda
env:
# Increase this value to reset cache if conda.yml and requirements.txt
# have not changed
CACHE_NUMBER: 0
steps:
- uses: actions/checkout@v2
- name: Checkout and setup python
uses: actions/setup-python@v2
with:
python-version: '3.10'
architecture: 'x64'
- name: Cache conda
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir # from: conda-incubator/setup-miniconda@v2
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda.yml') }}
- name: Cache pip
uses: actions/cache@v2
with:
path: ${{ matrix.pip_cache_path }}
key: ${{ runner.os }}-pip--${{ env.CACHE_NUMBER }}-${{
hashFiles('requirements.txt') }}
- name: IC50 - Conda environment setup
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: paccmann_predictor
environment-file: examples/IC50/conda.yml
auto-activate-base: false
use-only-tar-bz2: true # This needs to be set for proper caching
auto-update-conda: true # Required for windows for `use-only-tar-bz2`
- name: IC50 - Install dependencies and run tests
run: |
python3 -m pip install --upgrade pip
pip3 install --no-deps .
python3 -c "import paccmann_predictor"
python3 examples/IC50/train_paccmann.py -h
- name: Affinity - Conda environment setup
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: paccmann_predictor
environment-file: examples/affinity/conda.yml
auto-activate-base: false
use-only-tar-bz2: true # This needs to be set for proper caching
auto-update-conda: true # Required for windows for `use-only-tar-bz2`
- name: Install dependencies and test code
run: |
pip3 install -e .
python3 -c "import paccmann_predictor.models"
- name: Affinity - Install dependencies and run tests
run: |
python3 -m pip install --upgrade pip
pip3 install --no-cache-dir -r examples/affinity/requirements.txt
pip3 install --no-deps .
python3 -c "import paccmann_predictor"
python3 examples/affinity/train_affinity.py -h
- name: Send Slack notification
uses: 8398a7/action-slack@v2
if: always()
with:
status: ${{ job.status }}
text: "CI Build ${{ matrix.os }}"
author_name: ${{ github.actor }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_HOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}