forked from LumiSpy/lumispy
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.54 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
name: Tests
on: [push, pull_request]
jobs:
run_test_suite:
name: py${{ matrix.PYTHON_VERSION }}${{ matrix.LABEL }}
runs-on: ubuntu-latest
timeout-minutes: 30
env:
MPLBACKEND: agg
PIP_ARGS: --upgrade -e
PYTEST_ARGS: --pyargs lumispy
PYTEST_ARGS_COVERAGE:
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.7', '3.9', '3.10']
PIP_SELECTOR: ['[tests]']
include:
- PYTHON_VERSION: '3.8'
PIP_SELECTOR: '[tests, coverage]'
PYTEST_ARGS_COVERAGE: --cov=lumispy --cov-report=xml
LABEL: /coverage
steps:
- uses: actions/checkout@v4.0.0
- uses: actions/setup-python@v5
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 (HyperSpy dev)
# Test against the hyperspy `RELEASE_next_minor` branch
if: ${{ matrix.PYTEST_ARGS_COVERAGE }}
shell: bash
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_minor.zip
- 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@v3