Skip to content

Commit

Permalink
Add CI with GitHub Actions (#1)
Browse files Browse the repository at this point in the history
* Remove un-used import

* Add boilerplate GitHub Actions CI script taken from openforcefield/status#13

* Add channels to conda env YAML

* Fix some references to `openff_cli`
  • Loading branch information
mattwthompson authored Aug 4, 2020
1 parent 9e9f31b commit 3160e4a
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to contribute

We welcome contributions from external contributors, and this document
describes how to merge code changes into this openff_cli.
describes how to merge code changes into this openff-cli.

## Getting Started

Expand All @@ -19,7 +19,7 @@ describes how to merge code changes into this openff_cli.
[branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/)
with the branch name relating to the feature you are going to add.
* When you are ready for others to examine and comment on your new feature,
navigate to your fork of openff_cli on GitHub and open a [pull
navigate to your fork of openff-cli on GitHub and open a [pull
request](https://help.github.com/articles/using-pull-requests/) (PR). Note that
after you launch a PR from one of your fork's branches, all
subsequent commits to that branch will be added to the open pull request
Expand All @@ -29,7 +29,7 @@ describes how to merge code changes into this openff_cli.
* If you're providing a new feature, you must add test cases and documentation.
* When the code is ready to go, make sure you run the test suite using pytest.
* When you're ready to be considered for merging, check the "Ready to go"
box on the PR page to let the openff_cli devs know that the changes are complete.
box on the PR page to let the openff-cli devs know that the changes are complete.
The code will not be merged until this box is checked, the continuous
integration returns checkmarks,
and multiple core developers give "Approved" reviews.
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: ci

on:
push:
branches:
- "master"
- "maintenance/.+"
pull_request:
branches:
- "master"
- "maintenance/.+"
schedule:
# Run a cron job once daily
- cron: "0 0 * * *"

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.6, 3.7]
env:
PYVER: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2

- uses: goanpeca/setup-miniconda@v1
with:
python-version: ${{ matrix.python-version }}
activate-environment: test
channel-priority: true
environment-file: devtools/conda-envs/test_env.yaml
auto-activate-base: false

- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Environment Information
shell: bash -l {0}
run: |
conda info --all
conda list
- name: Install package
shell: bash -l {0}
run: |
python -m pip install --no-deps .
- name: Run tests
shell: bash -l {0}
run: |
PYTEST_ARGS=" -v --cov=openff/cli/ --cov-report=xml --cov-config=setup.cfg"
pytest $PYTEST_ARGS openff/cli/tests
- name: Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
fail_ci_if_error: true
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ include LICENSE
include MANIFEST.in
include versioneer.py

graft openff_cli
global-exclude *.py[cod] __pycache__ *.so
graft openff/cli
global-exclude *.py[cod] __pycache__ *.so
6 changes: 1 addition & 5 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: test
channels:
- conda-forge
dependencies:
# Base depends
- python
Expand All @@ -9,8 +10,3 @@ dependencies:
- pytest
- pytest-cov
- codecov

# Pip-only installs
#- pip:
# - codecov

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sys
sys.path.insert(0, os.path.abspath('..'))

import openff_cli
from openff import cli


# -- Project information -----------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion openff/cli/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_config():
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "None"
cfg.versionfile_source = "openff_cli/_version.py"
cfg.versionfile_source = "openff/cli/_version.py"
cfg.verbose = False
return cfg

Expand Down
6 changes: 0 additions & 6 deletions openff/cli/tests/test_openff_cli.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
"""
Unit and regression test for the openff_cli package.
"""

# Import package, test suite, and other packages as needed
from openff import cli
import pytest
import sys

def test_openff_cli_imported():
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ omit =
# Omit the tests
*/tests/*
# Omit generated versioneer
openff_cli/_version.py
openff/cli/_version.py

[yapf]
# YAPF, in .style.yapf files this shows up as "[style]" header
Expand All @@ -22,8 +22,8 @@ max-line-length = 119
# Automatic version numbering scheme
VCS = git
style = pep440
versionfile_source = openff_cli/_version.py
versionfile_build = openff_cli/_version.py
versionfile_source = openff/cli/_version.py
versionfile_build = openff/cli/_version.py
tag_prefix = ''

[aliases]
Expand Down

0 comments on commit 3160e4a

Please sign in to comment.