Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CI #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# The cookiecutter uses the "--initial-branch" flag when it runs git-init
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
# Weekly tests run on main by default:
# 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)
- cron: "0 0 * * 0"

defaults:
run:
shell: bash -l {0}

jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.8, 3.9, "3.10"]

steps:
- uses: actions/checkout@v3

- name: Additional info about the build
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/marketplace/actions/provision-with-micromamba
- uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: test-openmm-ml
extra-specs: |
python=${{ matrix.python-version }}
pip
- name: Install package
run: |
python -m pip install . --no-deps
micromamba list
- name: Run tests
run: |
# I don't want to deal with doing this the correct way for now, so yolo
cd test
pytest -v --cov=openmm-ml --cov-report=xml --color=yes TestMLPotential.py
- name: CodeCov
if: ${{ github.repository == 'openmm/openmm-ml'
&& github.event != 'schedule' }}
uses: codecov/codecov-action@v1
with:
file: ./test/coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
16 changes: 16 additions & 0 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: test-openmm-ml

channels:
- conda-forge
- conda-forge/label/openmm_rc
- conda-forge/label/openmm_dev

dependencies:
# core
- numpy
- openmm
- nnpops
- openmm-torch
# testing
- pytest
- pytest-cov