-
Notifications
You must be signed in to change notification settings - Fork 77
113 lines (102 loc) · 3.07 KB
/
on-push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: on-push
on: [push, pull_request]
jobs:
unit-tests:
runs-on: ${{ matrix.os }}-latest
strategy:
max-parallel: 5
matrix:
os: [ubuntu]
python: [3.8]
extras: ['']
include:
- os: macos
python: 3.8
- os: ubuntu
python: 3.9
extras: -minimal
# python-eccodes removed old versions from conda-forge
# - os: ubuntu
# python: 3.6
# extras: -minver
# python-eccodes fail on windows
# - os: windows
# python: 3.8
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
activate-environment: ${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }}
environment-file: tests/environment-${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }}.yml
- name: Test with pytest
shell: bash -l {0}
run: |
pip install --no-deps -e .
pytest -v --cov=. --cov-report=xml .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
activate-environment: ubuntu-3.8
environment-file: tests/environment-ubuntu-3.8.yml
- name: Build documentation with Sphinx
shell: bash -l {0}
run: |
conda install sphinx
pip install --no-deps -e .
python setup.py build_sphinx
- name: Test README with pytest
shell: bash -l {0}
run: |
pip install --no-deps -e .
pytest -v --cov=. --cov-report=xml *.rst
pytest -v --doctest-modules cfgrib
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
activate-environment: ubuntu-3.8
environment-file: tests/environment-ubuntu-3.8.yml
- name: Lint with flake8
shell: bash -l {0}
run: |
conda install flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Type check with mypy
shell: bash -l {0}
run: |
mypy cfgrib tests/test_*py
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check code style with black
run: |
$CONDA/bin/conda install black
$CONDA/bin/black --check .
- name: Check code style with isort
run: |
$CONDA/bin/conda install isort
$CONDA/bin/isort --check .
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check MANIFEST.in
run: |
$CONDA/bin/conda install -c conda-forge check-manifest
$CONDA/bin/check-manifest .
- name: Build distributions
run: |
$CONDA/bin/conda install pip setuptools wheel
$CONDA/bin/python setup.py sdist bdist_wheel