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

Switch to GitHub Actions and CodeCov #104

Merged
merged 12 commits into from
Dec 21, 2020
5 changes: 5 additions & 0 deletions .github/workflows/autorelease-default-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INSTALL_AUTORELEASE="python -m pip install autorelease==0.2.6"
if [ -f autorelease-env.sh ]; then
source autorelease-env.sh
fi

33 changes: 33 additions & 0 deletions .github/workflows/autorelease-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Autorelease
on:
release:
types: [published]

jobs:
deploy_pypi:
runs-on: ubuntu-latest
name: "Deploy to PyPI"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
fi
eval $INSTALL_AUTORELEASE
name: "Install autorelease"
- run: |
python -m pip install twine wheel
name: "Install release tools"
- run: |
python setup.py sdist bdist_wheel
twine check dist/*
name: "Build and check package"
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
name: "Deploy to pypi"

29 changes: 29 additions & 0 deletions .github/workflows/autorelease-gh-rel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Autorelease
on:
push:
branches:
- stable

jobs:
release-gh:
runs-on: ubuntu-latest
name: "Cut release"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.7"
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
fi
eval $INSTALL_AUTORELEASE
name: "Install autorelease"
- run: |
VERSION=`python setup.py --version`
PROJECT=`python setup.py --name`
echo $PROJECT $VERSION
autorelease-release --project $PROJECT --version $VERSION --token $AUTORELEASE_TOKEN
env:
AUTORELEASE_TOKEN: ${{ secrets.AUTORELEASE_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/autorelease-prep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Autorelease"
on:
pull_request:
branches:
- stable

defaults:
run:
shell: bash

jobs:
deploy_testpypi:
runs-on: ubuntu-latest
name: "Deployment test"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
fi
eval $INSTALL_AUTORELEASE
name: "Install autorelease"
- run: |
python -m pip install twine wheel
name: "Install release tools"
- run: |
bump-dev-version
python setup.py --version
name: "Bump testpypi dev version"
- run: |
python setup.py sdist bdist_wheel
twine check dist/*
name: "Build and check package"
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
name: "Deploy to testpypi"
test_testpypi:
runs-on: ubuntu-latest
name: "Test deployed"
needs: deploy_testpypi
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.x"
- run: | # TODO: move this to an action
source ./.github/workflows/autorelease-default-env.sh
if [ -f "autorelease-env.sh" ]; then
cat autorelease-env.sh >> $GITHUB_ENV
fi
eval $INSTALL_AUTORELEASE
name: "Install autorelease"
- run: test-testpypi

65 changes: 65 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "Unit tests"
on:
pull_request:
branches:
- master
- stable
push:
branches:
- master
tags:
- "v*"
schedule:
- cron: "20 5 * * *"

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

jobs:
test_suite:
runs-on: ubuntu-latest
name: "Unit Tests"
strategy:
matrix:
CONDA_PY:
- 3.9
- 3.8
- 3.7
- 3.6
MDTRAJ: ["mdtraj-release"]
include:
- CONDA_PY: 3.9
MDTRAJ: "mdtraj-dev"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-python: true
python-version: ${{ matrix.CONDA_PY }}
- name: "Install"
env:
MDTRAJ: ${{ matrix.MDTRAJ }}
run: |
source ci/pip-install/install_requirements.sh
pip install -e .
pip install -U -r ci/pip-install/testing_requirements.txt
if [ "$MDTRAJ" = "mdtraj-dev" ]; then
pip install --upgrade --force-reinstall -r ci/pip-install/mdtraj_dev.txt
pip install -r optional_installs.txt
fi
- name: "Versions"
run: pip list
- name: "Autorelease check"
run: python autorelease_check.py
- name: "Tests"
env:
PY_COLORS: "1"
run: |
python -c "import contact_map"
py.test -vv --cov=contact_map --cov-report xml
- name: "Report coverage"
if: ${{ github.event }} != "schedule"
run: bash <(curl -s https://codecov.io/bash)
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![Documentation Status](https://readthedocs.org/projects/contact-map/badge/?version=latest)](http://contact-map.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.com/dwhswenson/contact_map.svg?branch=master)](https://travis-ci.com/dwhswenson/contact_map)
![Unit tests](https://github.com/dwhswenson/contact_map/workflows/Unit%20tests/badge.svg)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/em3fo96sjrg2vmcc/branch/master?svg=true)](https://ci.appveyor.com/project/dwhswenson/contact-map/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/dwhswenson/contact_map/badge.svg?branch=master)](https://coveralls.io/github/dwhswenson/contact_map?branch=master)
[![codecov](https://codecov.io/gh/dwhswenson/contact_map/branch/master/graph/badge.svg?token=4so8QmiC5W)](https://codecov.io/gh/dwhswenson/contact_map)
[![PyPI](https://img.shields.io/pypi/v/contact-map.svg)](https://pypi.python.org/pypi/contact-map/)
[![conda-forge](https://img.shields.io/conda/v/conda-forge/contact_map.svg)](https://github.com/conda-forge/contact_map-feedstock)

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dwhswenson/contact_map/master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f7f3cf53698e4655ac8895f13fa5dea6)](https://www.codacy.com/app/dwhswenson/contact_map?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=dwhswenson/contact_map&amp;utm_campaign=Badge_Grade)
[![Maintainability](https://api.codeclimate.com/v1/badges/84768756d594176d8da6/maintainability)](https://codeclimate.com/github/dwhswenson/contact_map/maintainability)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dwhswenson/contact_map/master)
# Contact Map Explorer

This package provides tools for analyzing and exploring contacts
Expand Down
2 changes: 1 addition & 1 deletion autorelease_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
)
checker.release_branches = RELEASE_BRANCHES + [RELEASE_TAG]

tests = checker.select_tests_from_sysargs()
tests = checker.select_tests()
n_fails = checker.run_as_test(tests)