Skip to content

Commit

Permalink
[CI] switch from Travis CI to GitHub actions
Browse files Browse the repository at this point in the history
- fix #146
- test MDAnalysis >= 1.0.0, <2 (noted in CHANGELOG)
  • Loading branch information
orbeckst committed Oct 10, 2021
1 parent 6c037c8 commit 49cc764
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 134 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: docs deployment
on:
push:
branches:
- master

concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}"
cancel-in-progress: true

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

jobs:
docs:
if: "github.repository == 'MDAnalysis/pmda'"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.7
auto-update-conda: true
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
mamba-version: "*"

- name: install package deps
run: |
mamba install 'mdanalysis<2' dask distributed sphinx
pip install sphinx-sitemap sphinx-rtd-theme
- name: check install
run: |
which python
which pip
conda info
conda list
- name: install package
run: |
pip install -v .
- name: build docs
run: |
python setup.py build_sphinx
- name: deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/sphinx/html
user_name: 'github-actions'
user_email: 'github-action@users.noreply.github.com'
152 changes: 152 additions & 0 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: GH Actions CI
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master

concurrency:
# Probably overly cautious group naming.
# Commits to develop/master will cancel each other, but PRs will only cancel
# commits within the same PR
group: "${{ github.ref }}-${{ github.head_ref }}"
cancel-in-progress: true

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

jobs:
unittests:
if: "github.repository == 'MDAnalysis/pmda'"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ]
python-version: [2.7, 3.7, 3.8, 3.9]
include:
- name: macOS_bigsur_py39
os: macOS-11
python-version: 3.9
- name: macOS_catalina_py37
os: macOS-10.15
python-version: 3.7
env:
CYTHON_TRACE_NOGIL: 1
MPLBACKEND: agg
GH_OS: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
channel-priority: flexible
# The order of these channel matters: both provide "fundamental"
# software (curl, ssh, ...), but the version in biobuilds are very
# outdated. This can lead to problem when loading shared libraries,
# see https://github.com/MDAnalysis/mdanalysis/pull/3126#issuecomment-813112080
channels: conda-forge, biobuilds
add-pip-as-python-dependency: true
mamba-version: "*"
architecture: x64

- name: install_deps
run: |
mamba install 'mdanalysis>=1,<2' 'mdanalysistests>=1,<2' dask distributed joblib mock codecov
pip install 'coverage<5' 'pytest-cov==2.10.1' pytest-xdist
- name: check_setup
run: |
# Check OS and python setup
echo "OS: ${OS_NAME}"
which python
which pip
pip list
conda info
conda list
- name: install PMDA package
run: python -m pip install -v .

- name: run tests
run: |
pytest -v --cov=pmda --cov-report=xml --color=yes ./pmda/test
- name: codecov
uses: codecov/codecov-action@v2
with:
file: coverage.xml
fail_ci_if_error: True
verbose: True

pylint_check:
if: "github.repository == 'MDAnalysis/pmda'"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.7
auto-update-conda: true
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
architecture: x64

- name: install
run: |
which pip
which python
pip install pylint
- name: pylint
env:
PYLINTRC: .pylintrc
run: |
pylint pmda
pypi_check:
if: "github.repository == 'MDAnalysis/pmda'"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.7
auto-update-conda: true
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
# mamba not enabled as install longer than deps install
architecture: x64

- name: install_conda
run: |
conda install setuptools twine
- name: install PMDA
run: |
python setup.py sdist
- name: check package build
run: |
DISTRIBUTION=$(ls -t1 dist/pmda-*.tar.gz | head -n 1)
test -n "${DISTRIBUTION}" || { echo "no distribution dist/pmda-*.tar.gz found"; exit 1; }
echo "twine check $DISTRIBUTION"
twine check $DISTRIBUTION
76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Fixes
* raise ValueError when n_blocks > n_frames (Issue #137, PR #138)

Changes
* requires MDAnalysis >= 1.0.0 (#122)
* requires MDAnalysis >= 1.0.0 and <2.0.0 (#122)
* dropped official support for Python 3.5 (2.7 and >= 3.6 are supported)


Expand Down
55 changes: 0 additions & 55 deletions ci/deploy_docs.sh

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
packages=find_packages(),
install_requires=[
'MDAnalysis>=1.0.0',
'MDAnalysis>=1.0.0,<2',
'dask>=0.18',
'distributed',
'six',
Expand All @@ -58,5 +58,5 @@
],
tests_require=[
'pytest',
'MDAnalysisTests>=1.0.0', # keep
'MDAnalysisTests>=1.0.0,<2', # keep
], )

0 comments on commit 49cc764

Please sign in to comment.