forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (100 loc) · 3.57 KB
/
tests.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
name: Tests
on: [push, pull_request]
jobs:
run_test_site:
name: ${{ matrix.os }}-py${{ matrix.PYTHON_VERSION }}${{ matrix.LABEL }}
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
env:
MPLBACKEND: agg
PIP_ARGS: --upgrade -e
PYTEST_ARGS: --pyargs hyperspy --reruns 3 -n 2 --instafail
PYTEST_ARGS_COVERAGE:
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
PYTHON_VERSION: [3.8, 3.9]
PIP_SELECTOR: ['[all, tests]']
DEPENDENCIES_DEV: [false]
include:
# test oldest supported version of main dependencies on python 3.6
- os: ubuntu
PYTHON_VERSION: 3.6
OLDEST_SUPPORTED_VERSION: true
DEPENDENCIES: matplotlib==3.1.0 numpy==1.17.1 scipy==1.1 imagecodecs==2019.12.3 dask==2.1.0
PIP_SELECTOR: '[all, tests, coverage]'
PYTEST_ARGS_COVERAGE: --cov=. --cov-report=xml
LABEL: -oldest
# test minimum requirement
- os: ubuntu
PYTHON_VERSION: 3.8
PIP_SELECTOR: '[tests]'
LABEL: -minimum
# Run coverage
- os: ubuntu
PYTHON_VERSION: 3.8
PIP_SELECTOR: '[all, tests, coverage]'
PYTEST_ARGS_COVERAGE: --cov=. --cov-report=xml
LABEL: -coverage
# Run test suite against dependencies development version
- os: ubuntu
PYTHON_VERSION: 3.8
PIP_SELECTOR: '[all, tests]'
LABEL: -dependencies_dev
DEPENDENCIES_DEV: true
DEPENDENCIES: numpy scipy scikit-learn scikit-image
- os: ubuntu
PYTHON_VERSION: 3.7
PIP_SELECTOR: '[all, tests]'
exclude:
# redundant build (same as coverage)
- os: ubuntu
PYTHON_VERSION: 3.8
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Display version
run: |
python --version
pip --version
- name: Install
shell: bash
run: |
pip install ${{ env.PIP_ARGS }} .'${{ matrix.PIP_SELECTOR }}'
- name: Install oldest supported version
if: ${{ matrix.OLDEST_SUPPORTED_VERSION }}
run: |
pip install ${{ matrix.DEPENDENCIES }}
- name: Install dependencies development version
if: ${{ matrix.DEPENDENCIES_DEV }}
run: |
pip install --upgrade --no-deps --pre \
-i https://pypi.anaconda.org/scipy-wheels-nightly/simple \
${{ matrix.DEPENDENCIES }}
- name: Run test suite
run: |
pytest ${{ env.PYTEST_ARGS }} ${{ matrix.PYTEST_ARGS_COVERAGE }}
- name: Upload coverage to Codecov
if: ${{ always() }} && ${{ matrix.PYTEST_ARGS_COVERAGE }}
uses: codecov/codecov-action@v1
build_doc:
name: Build doc
runs-on: ubuntu-latest
env:
BUILD_DEPS: python3-dev build-essential graphviz
LATEX_DEPS: dvipng latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
steps:
- uses: actions/checkout@v2
- uses: ammaraskar/sphinx-action@master
with:
pre-build-command: "apt-get update -y && apt-get install -y ${{ env.BUILD_DEPS }} ${{ env.LATEX_DEPS }} && pip install -e .[all,build-doc]"
build-command: make html
docs-folder: doc/
- uses: actions/upload-artifact@v2
with:
path: ./doc/_build/html/
name: doc_build