Skip to content

Commit e3154e1

Browse files
authored
Merge pull request #2 from andersy005/CI
Set up Github Action CI
2 parents 4195fa2 + 9b67abb commit e3154e1

File tree

6 files changed

+113
-0
lines changed

6 files changed

+113
-0
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
[run]
3+
omit =
4+
tests/*.py
5+
setup.py

.github/workflows/main.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: "*"
6+
pull_request:
7+
branches: "*"
8+
schedule:
9+
- cron: "0 0 * * *"
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ['3.6', '3.7', '3.8']
17+
name: Python ${{ matrix.python-version }} build
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v1
21+
- name: Install Python
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
architecture: "x64"
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install "dask[complete]" xarray toolz pytest codecov pytest-cov
29+
python -m pip install .
30+
- name: Run tests
31+
run: |
32+
pytest --junitxml=test-reports/junit.xml --cov=./ --verbose
33+
- name: Upload coverage
34+
run: |
35+
codecov

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
repos:
2+
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v2.4.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-docstring-first
9+
- id: check-json
10+
- id: check-yaml
11+
- id: double-quote-string-fixer
12+
13+
- repo: https://github.com/ambv/black
14+
rev: 19.10b0
15+
hooks:
16+
- id: black
17+
args: ["--line-length", "100", "--skip-string-normalization"]
18+
19+
- repo: https://github.com/pre-commit/pre-commit-hooks
20+
rev: v2.4.0
21+
hooks:
22+
- id: flake8
23+
24+
- repo: https://github.com/asottile/seed-isort-config
25+
rev: v1.9.3
26+
hooks:
27+
- id: seed-isort-config
28+
- repo: https://github.com/pre-commit/mirrors-isort
29+
rev: v4.3.21
30+
hooks:
31+
- id: isort

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
![Github Actions Status](https://github.com/matt-long/xpersist/workflows/CI/badge.svg)
2+
[![codecov](https://codecov.io/gh/matt-long/xpersist/branch/master/graph/badge.svg)](https://codecov.io/gh/matt-long/xpersist)
3+
[![PyPI](https://img.shields.io/pypi/v/xpersist.svg)](https://pypi.python.org/pypi/xpersist)
14

25
# xpersist
36

codecov.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
codecov:
2+
max_report_age: off
3+
4+
comment: false
5+
6+
coverage:
7+
precision: 2
8+
round: down
9+
status:
10+
project:
11+
default:
12+
threshold: 0.2
13+
if_not_found: success
14+
patch:
15+
default:
16+
enabled: no
17+
if_not_found: success
18+
changes:
19+
default:
20+
enabled: no
21+
if_not_found: success

setup.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[flake8]
2+
exclude = docs
3+
ignore = E203,E266,E501,W503,E722,E402,C901
4+
max-line-length = 100
5+
max-complexity = 18
6+
select = B,C,E,F,W,T4,B9
7+
8+
[isort]
9+
known_first_party=intake_esm
10+
known_third_party=dask,numpy,pytest,setuptools,toolz,xarray
11+
multi_line_output=3
12+
include_trailing_comma=True
13+
force_grid_wrap=0
14+
combine_as_imports=True
15+
line_length=100
16+
skip=
17+
docs/source/conf.py
18+
setup.py

0 commit comments

Comments
 (0)