Skip to content

Commit 49cc764

Browse files
committed
[CI] switch from Travis CI to GitHub actions
- fix #146 - test MDAnalysis >= 1.0.0, <2 (noted in CHANGELOG)
1 parent 6c037c8 commit 49cc764

File tree

6 files changed

+214
-134
lines changed

6 files changed

+214
-134
lines changed

.github/workflows/docs.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: docs deployment
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
concurrency:
8+
group: "${{ github.ref }}-${{ github.head_ref }}"
9+
cancel-in-progress: true
10+
11+
defaults:
12+
run:
13+
shell: bash -l {0}
14+
15+
jobs:
16+
docs:
17+
if: "github.repository == 'MDAnalysis/pmda'"
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: setup_miniconda
24+
uses: conda-incubator/setup-miniconda@v2
25+
with:
26+
python-version: 3.7
27+
auto-update-conda: true
28+
channel-priority: flexible
29+
channels: conda-forge
30+
add-pip-as-python-dependency: true
31+
mamba-version: "*"
32+
33+
- name: install package deps
34+
run: |
35+
mamba install 'mdanalysis<2' dask distributed sphinx
36+
pip install sphinx-sitemap sphinx-rtd-theme
37+
38+
- name: check install
39+
run: |
40+
which python
41+
which pip
42+
conda info
43+
conda list
44+
45+
- name: install package
46+
run: |
47+
pip install -v .
48+
49+
- name: build docs
50+
run: |
51+
python setup.py build_sphinx
52+
53+
- name: deploy docs
54+
uses: peaceiris/actions-gh-pages@v3
55+
with:
56+
github_token: ${{ secrets.GITHUB_TOKEN }}
57+
publish_dir: ./build/sphinx/html
58+
user_name: 'github-actions'
59+
user_email: 'github-action@users.noreply.github.com'

.github/workflows/gh-ci.yaml

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
name: GH Actions CI
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
- master
7+
pull_request:
8+
branches:
9+
- develop
10+
- master
11+
12+
concurrency:
13+
# Probably overly cautious group naming.
14+
# Commits to develop/master will cancel each other, but PRs will only cancel
15+
# commits within the same PR
16+
group: "${{ github.ref }}-${{ github.head_ref }}"
17+
cancel-in-progress: true
18+
19+
defaults:
20+
run:
21+
shell: bash -l {0}
22+
23+
jobs:
24+
unittests:
25+
if: "github.repository == 'MDAnalysis/pmda'"
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest, ]
31+
python-version: [2.7, 3.7, 3.8, 3.9]
32+
include:
33+
- name: macOS_bigsur_py39
34+
os: macOS-11
35+
python-version: 3.9
36+
- name: macOS_catalina_py37
37+
os: macOS-10.15
38+
python-version: 3.7
39+
env:
40+
CYTHON_TRACE_NOGIL: 1
41+
MPLBACKEND: agg
42+
GH_OS: ${{ matrix.os }}
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
47+
- name: setup_miniconda
48+
uses: conda-incubator/setup-miniconda@v2
49+
with:
50+
python-version: ${{ matrix.python-version }}
51+
auto-update-conda: true
52+
channel-priority: flexible
53+
# The order of these channel matters: both provide "fundamental"
54+
# software (curl, ssh, ...), but the version in biobuilds are very
55+
# outdated. This can lead to problem when loading shared libraries,
56+
# see https://github.com/MDAnalysis/mdanalysis/pull/3126#issuecomment-813112080
57+
channels: conda-forge, biobuilds
58+
add-pip-as-python-dependency: true
59+
mamba-version: "*"
60+
architecture: x64
61+
62+
- name: install_deps
63+
run: |
64+
mamba install 'mdanalysis>=1,<2' 'mdanalysistests>=1,<2' dask distributed joblib mock codecov
65+
pip install 'coverage<5' 'pytest-cov==2.10.1' pytest-xdist
66+
67+
- name: check_setup
68+
run: |
69+
# Check OS and python setup
70+
echo "OS: ${OS_NAME}"
71+
which python
72+
which pip
73+
pip list
74+
conda info
75+
conda list
76+
77+
- name: install PMDA package
78+
run: python -m pip install -v .
79+
80+
- name: run tests
81+
run: |
82+
pytest -v --cov=pmda --cov-report=xml --color=yes ./pmda/test
83+
84+
- name: codecov
85+
uses: codecov/codecov-action@v2
86+
with:
87+
file: coverage.xml
88+
fail_ci_if_error: True
89+
verbose: True
90+
91+
pylint_check:
92+
if: "github.repository == 'MDAnalysis/pmda'"
93+
runs-on: ubuntu-latest
94+
95+
steps:
96+
- uses: actions/checkout@v2
97+
98+
- name: setup_miniconda
99+
uses: conda-incubator/setup-miniconda@v2
100+
with:
101+
python-version: 3.7
102+
auto-update-conda: true
103+
channel-priority: flexible
104+
channels: conda-forge
105+
add-pip-as-python-dependency: true
106+
architecture: x64
107+
108+
- name: install
109+
run: |
110+
which pip
111+
which python
112+
pip install pylint
113+
114+
- name: pylint
115+
env:
116+
PYLINTRC: .pylintrc
117+
run: |
118+
pylint pmda
119+
120+
121+
pypi_check:
122+
if: "github.repository == 'MDAnalysis/pmda'"
123+
runs-on: ubuntu-latest
124+
125+
steps:
126+
- uses: actions/checkout@v2
127+
128+
- name: setup_miniconda
129+
uses: conda-incubator/setup-miniconda@v2
130+
with:
131+
python-version: 3.7
132+
auto-update-conda: true
133+
channel-priority: flexible
134+
channels: conda-forge
135+
add-pip-as-python-dependency: true
136+
# mamba not enabled as install longer than deps install
137+
architecture: x64
138+
139+
- name: install_conda
140+
run: |
141+
conda install setuptools twine
142+
143+
- name: install PMDA
144+
run: |
145+
python setup.py sdist
146+
147+
- name: check package build
148+
run: |
149+
DISTRIBUTION=$(ls -t1 dist/pmda-*.tar.gz | head -n 1)
150+
test -n "${DISTRIBUTION}" || { echo "no distribution dist/pmda-*.tar.gz found"; exit 1; }
151+
echo "twine check $DISTRIBUTION"
152+
twine check $DISTRIBUTION

.travis.yml

-76
This file was deleted.

CHANGELOG

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Fixes
3333
* raise ValueError when n_blocks > n_frames (Issue #137, PR #138)
3434

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

3939

ci/deploy_docs.sh

-55
This file was deleted.

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
packages=find_packages(),
5050
install_requires=[
51-
'MDAnalysis>=1.0.0',
51+
'MDAnalysis>=1.0.0,<2',
5252
'dask>=0.18',
5353
'distributed',
5454
'six',
@@ -58,5 +58,5 @@
5858
],
5959
tests_require=[
6060
'pytest',
61-
'MDAnalysisTests>=1.0.0', # keep
61+
'MDAnalysisTests>=1.0.0,<2', # keep
6262
], )

0 commit comments

Comments
 (0)