Skip to content

Commit 99ff4b6

Browse files
authored
Merge pull request #97 from Z2PackDev/move_to_gh_actions
Add Github actions workflow
2 parents b12cd4b + 1f6336c commit 99ff4b6

File tree

8 files changed

+306
-54
lines changed

8 files changed

+306
-54
lines changed

.travis-data/install_script.sh renamed to .ci/install_script.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
# Be verbose, and stop with error as soon there's one
66
set -ev
77

8-
cd ${TRAVIS_BUILD_DIR}
9-
108
pip install codecov
119
pip install -U setuptools wheel
1210

.travis-data/test_script.sh renamed to .ci/test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -ev
88

99
case "$TEST_TYPE" in
1010
tests)
11-
pytest --cov=tbmodels --cov-config=.coveragerc
11+
1212
;;
1313
precommit)
1414
pre-commit run --all-files

.github/workflows/ci.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Continuous Integration
2+
3+
on: [push, pull_request]
4+
jobs:
5+
docs:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
python-version: [3.8]
10+
install-type: [dev]
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
15+
- name: Install apt dependencies
16+
run: |
17+
sudo apt update -qq
18+
sudo apt install -qq liblapack3 liblapack-dev
19+
20+
- uses: actions/cache@v2
21+
with:
22+
path: ~/.cache/pip
23+
key: pip-${{ matrix.python-version }}-${{ matrix.install-type }}-${{ hashFiles('**/setup.json')
24+
}}
25+
restore-keys: pip-${{ matrix.python-version }}-${{ matrix.install-type }}
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Install the python project
33+
env:
34+
INSTALL_TYPE: ${{ matrix.install-type }}
35+
run: .ci/install_script.sh
36+
37+
- name: Build documentation
38+
env:
39+
READTHEDOCS: 'True'
40+
run: SPHINXOPTS='-nW' make -C doc html
41+
- uses: actions/upload-artifact@v2
42+
with:
43+
name: doc-build
44+
path: doc/build/html
45+
46+
pre-commit:
47+
runs-on: ubuntu-latest
48+
strategy:
49+
matrix:
50+
python-version: [3.8]
51+
install-type: [dev]
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v2
55+
56+
- name: Install apt dependencies
57+
run: |
58+
sudo apt update -qq
59+
sudo apt install -qq liblapack3 liblapack-dev
60+
61+
- uses: actions/cache@v2
62+
with:
63+
path: ~/.cache/pip
64+
key: pip-${{ matrix.python-version }}-${{ matrix.install-type }}-${{ hashFiles('**/setup.json')
65+
}}
66+
restore-keys: pip-${{ matrix.python-version }}-${{ matrix.install-type }}
67+
68+
- name: Set up Python
69+
uses: actions/setup-python@v2
70+
with:
71+
python-version: ${{ matrix.python-version }}
72+
73+
- name: Install the python project
74+
env:
75+
INSTALL_TYPE: ${{ matrix.install-type }}
76+
run: .ci/install_script.sh
77+
78+
- name: Run pre-commit
79+
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1
80+
)
81+
tests:
82+
runs-on: ubuntu-latest
83+
strategy:
84+
matrix:
85+
python-version: [3.6, 3.7, 3.8]
86+
install-type: [dev]
87+
include:
88+
- python-version: 3.8
89+
install-type: dev_sdist
90+
- python-version: 3.8
91+
install-type: dev_bdist_wheel
92+
steps:
93+
- name: Checkout code
94+
uses: actions/checkout@v2
95+
96+
- name: Install apt dependencies
97+
run: |
98+
sudo apt update -qq
99+
sudo apt install -qq liblapack3 liblapack-dev
100+
101+
- uses: actions/cache@v2
102+
with:
103+
path: ~/.cache/pip
104+
key: pip-${{ matrix.python-version }}-${{ matrix.install-type }}-${{ hashFiles('**/setup.json')
105+
}}
106+
restore-keys: pip-${{ matrix.python-version }}-${{ matrix.install-type }}
107+
108+
- name: Set up Python
109+
uses: actions/setup-python@v2
110+
with:
111+
python-version: ${{ matrix.python-version }}
112+
113+
- name: Install the python project
114+
env:
115+
INSTALL_TYPE: ${{ matrix.install-type }}
116+
run: .ci/install_script.sh
117+
118+
- name: Run pytest
119+
run: pytest --cov=tbmodels --cov-config=.coveragerc
120+
- name: Run codecov
121+
run: codecov

.github/workflows_source/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Continuous Integration
2+
3+
on: [push, pull_request]
4+
5+
_anchors:
6+
checkout: &CHECKOUT
7+
name: Checkout code
8+
uses: actions/checkout@v2
9+
10+
apt-dependencies: &APT_DEPENDENCIES
11+
name: Install apt dependencies
12+
run: |
13+
sudo apt update -qq
14+
sudo apt install -qq liblapack3 liblapack-dev
15+
16+
pip-cache: &PIP_CACHE
17+
uses: actions/cache@v2
18+
with:
19+
path: ~/.cache/pip
20+
key: pip-${{ matrix.python-version }}-${{ matrix.install-type }}-${{ hashFiles('**/setup.json') }}
21+
restore-keys: pip-${{ matrix.python-version }}-${{ matrix.install-type }}
22+
23+
python-setup: &PYTHON_SETUP
24+
name: Set up Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
29+
install-project: &INSTALL_PROJECT
30+
name: Install the python project
31+
env:
32+
INSTALL_TYPE: ${{ matrix.install-type }}
33+
run: .ci/install_script.sh
34+
35+
jobs:
36+
docs:
37+
runs-on: ubuntu-latest
38+
strategy:
39+
matrix:
40+
python-version: [3.8]
41+
install-type: [dev]
42+
steps:
43+
- *CHECKOUT
44+
- *APT_DEPENDENCIES
45+
- *PIP_CACHE
46+
- *PYTHON_SETUP
47+
- *INSTALL_PROJECT
48+
- name: Build documentation
49+
env:
50+
READTHEDOCS: "True"
51+
run: SPHINXOPTS='-nW' make -C doc html
52+
- uses: actions/upload-artifact@v2
53+
with:
54+
name: doc-build
55+
path: doc/build/html
56+
57+
pre-commit:
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
python-version: [3.8]
62+
install-type: [dev]
63+
steps:
64+
- *CHECKOUT
65+
- *APT_DEPENDENCIES
66+
- *PIP_CACHE
67+
- *PYTHON_SETUP
68+
- *INSTALL_PROJECT
69+
- name: Run pre-commit
70+
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
71+
tests:
72+
runs-on: ubuntu-latest
73+
strategy:
74+
matrix:
75+
python-version: [3.6, 3.7, 3.8]
76+
install-type: [dev]
77+
include:
78+
- python-version: 3.8
79+
install-type: dev_sdist
80+
- python-version: 3.8
81+
install-type: dev_bdist_wheel
82+
steps:
83+
- *CHECKOUT
84+
- *APT_DEPENDENCIES
85+
- *PIP_CACHE
86+
- *PYTHON_SETUP
87+
- *INSTALL_PROJECT
88+
- name: Run pytest
89+
run: pytest --cov=tbmodels --cov-config=.coveragerc
90+
- name: Run codecov
91+
run: codecov

.pre-commit-config.yaml

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
repos:
2-
- repo: https://github.com/asottile/pyupgrade
3-
rev: v2.7.2
4-
hooks:
5-
- id: pyupgrade
6-
args: [--py36-plus]
7-
- repo: https://github.com/psf/black
8-
rev: 20.8b1
9-
hooks:
10-
- id: black
11-
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: v0.782
13-
hooks:
14-
- id: mypy
15-
exclude: '^(doc/)|(examples/)|(playground/)'
16-
- repo: local
17-
hooks:
18-
- id: pylint
19-
name: pylint
20-
entry: pylint
21-
language: system
22-
types: [python]
23-
exclude: '^(doc/)|(examples/)|(playground/)'
2+
- repo: https://github.com/asottile/pyupgrade
3+
rev: v2.7.2
4+
hooks:
5+
- id: pyupgrade
6+
args: [--py36-plus]
7+
- repo: https://github.com/psf/black
8+
rev: 20.8b1
9+
hooks:
10+
- id: black
11+
- repo: https://github.com/pre-commit/mirrors-mypy
12+
rev: v0.782
13+
hooks:
14+
- id: mypy
15+
exclude: "^(doc/)|(examples/)|(playground/)"
16+
- repo: local
17+
hooks:
18+
- id: pylint
19+
name: pylint
20+
entry: pylint
21+
language: system
22+
types: [python]
23+
exclude: "^(doc/)|(examples/)|(playground/)|(utils/)"
24+
- id: interpolate-workflows
25+
name: Interpolate Github workflows
26+
entry: python ./utils/interpolate_yaml_anchors.py
27+
language: system
28+
files: |
29+
(?x)^(
30+
.github/(.)*|
31+
utils/interpolate_yaml_anchors.py
32+
)$
33+
pass_filenames: false

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ classifiers =
2222
Programming Language :: Python :: 3.6
2323
Programming Language :: Python :: 3.7
2424
Programming Language :: Python :: 3.8
25+
Programming Language :: Python :: 3.9
2526
Intended Audience :: Science/Research
2627
Topic :: Scientific/Engineering :: Physics
2728

@@ -32,7 +33,7 @@ setup_requires =
3233
install_requires =
3334
numpy
3435
scipy>=0.15
35-
h5py
36+
h5py>=3.0.0
3637
fsc.export
3738
symmetry-representation>=0.2
3839
click>=7.0, !=7.1.0
@@ -57,6 +58,7 @@ dev =
5758
pylint==2.6.0
5859
isort==5.5.1
5960
mypy==0.782
61+
ruamel.yaml
6062

6163
[options.entry_points]
6264
console_scripts =

0 commit comments

Comments
 (0)