Skip to content

CI

CI #399

Workflow file for this run

name: CI
on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
push:
branches:
- "master"
- "main"
pull_request:
branches:
- "master"
- "main"
schedule:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
# Workflow will run at 8:00 on the first day of the month
- cron: "0 8 1 * *"
jobs:
testCI:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [macOS-latest, ubuntu-latest, windows-latest]
os: [macOS-latest, ubuntu-latest]
python-version: [3.7, 3.9]
steps:
- uses: actions/checkout@v2
- name: Install conda environment
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
- name: Check conda environment
shell: bash -l {0}
run: conda list
- name: Install package
shell: bash -l {0}
run: |
python -m pip install -e .
- name: Run training example
shell: bash -l {0}
run: |
python maxsmi/full_workflow.py --aug-strategy-train=augmentation_without_duplication --aug-nb-train=2 --aug-nb-test=2 --nb-epochs=2
- name: Run training example with early stopping
shell: bash -l {0}
run: |
python maxsmi/full_workflow_earlystopping.py --aug-nb-train=3 --aug-nb-test=2 --nb-epochs=2
- name: Run user prediction example
shell: bash -l {0}
run: |
python maxsmi/prediction_unlabeled_data.py --task=lipophilicity --smiles_prediction="CC1CC1"
- name: Generate code coverage report
shell: bash -l {0}
run: pytest --cov=./ --cov-report=xml --color=yes
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella-${{ matrix.os }}-py${{ matrix.python-version }}