-
Notifications
You must be signed in to change notification settings - Fork 8
141 lines (130 loc) · 4.1 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: on-push
on: [push, pull_request]
jobs:
unit-tests:
runs-on: ${{ matrix.os }}-latest
strategy:
max-parallel: 5
matrix:
os: [ubuntu]
python: ["3.7", "3.8", "3.9", "3.10"]
extras: ['']
include:
- os: macos
python: "3.8"
- os: ubuntu
python: "3.8"
extras: -minimal
# python-eccodes and cffi both fail
# - os: windows
# python: 3.8
steps:
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.4.3-0'
environment-name: ${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }}
environment-file: tests/environment-${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }}.yml
create-args: python=${{ matrix.python }}
- name: Test with pytest
shell: bash -l {0}
run: |
micromamba install pytest pytest-cov tomli
pip install --no-deps -e .
pytest -v --cov=. --cov-report=xml -k 'not test_notebooks' .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
- name: Install test tools for notebooks
shell: bash -l {0}
run: |
micromamba install pytest nbformat nbconvert ipykernel
pytest -v -k 'test_notebooks' .
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.4.3-0'
environment-name: ubuntu-3.8
environment-file: tests/environment-ubuntu-3.8.yml
create-args: python=${{ matrix.python }}
- name: Build documentation with Sphinx
shell: bash -l {0}
run: |
micromamba install sphinx
micromamba install sphinx_rtd_theme -c conda-forge
micromamba install ipykernel
micromamba install pandoc
micromamba install nbsphinx
micromamba install ipython_genutils
micromamba install jinja2=3.0.3
pip install --no-deps -e .
python setup.py build_sphinx
# - name: Test README with pytest
# shell: bash -l {0}
# run: |
# conda install pytest pytest-cov tomli
# pip install --no-deps -e .
# pytest -v --cov=. --cov-report=xml README.rst
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.4.3-0'
environment-name: ubuntu-3.8
environment-file: tests/environment-ubuntu-3.8.yml
create-args: python=3.8
- name: Lint with flake8
shell: bash -l {0}
run: |
micromamba 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: |
micromamba install mypy pytest
mypy --strict .
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.4.3-0'
environment-name: ubuntu-3.8
environment-file: tests/environment-ubuntu-3.8.yml
create-args: python=3.8
- name: Check code style with black
shell: bash -l {0}
run: |
micromamba install black
black --check .
- name: Check code style with isort
shell: bash -l {0}
run: |
micromamba install isort
isort --check .
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.4.3-0'
environment-name: ubuntu-3.8
environment-file: tests/environment-ubuntu-3.8.yml
create-args: python=3.8
- name: Check MANIFEST.in
shell: bash -l {0}
run: |
micromamba install -c conda-forge check-manifest
check-manifest .
- name: Build distributions
shell: bash -l {0}
run: |
micromamba install pip setuptools wheel
python setup.py sdist bdist_wheel