forked from ecmwf/eccodes-python
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.76 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
name: on-push
on: [push]
jobs:
unit-tests:
runs-on: ${{ matrix.os }}-latest
strategy:
max-parallel: 5
matrix:
os: [ubuntu]
python: [3.6, 3.7, 3.8]
include:
- os: macos
python: 3.8
- 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 }}
# environment-file: tests/environment-${{ matrix.os }}-${{ matrix.python }}.yml
environment-file: tests/environment.yml
- name: Test with pytest
shell: bash -l {0}
run: |
conda install pytest pytest-cov
python -m pip install --no-deps -e .
pytest -v --cov=. --cov-report=xml --cov-branch .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint with flake8
run: |
$CONDA/bin/conda install flake8
# stop the build if there are Python syntax errors or undefined names
$CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
$CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check code style with black
run: |
$CONDA/bin/conda install -c conda-forge black
$CONDA/bin/black --check .
- name: Check code style with isort
run: |
$CONDA/bin/conda install isort
$CONDA/bin/isort .