-
Notifications
You must be signed in to change notification settings - Fork 13
77 lines (65 loc) · 2.26 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
name: Tests
on: [push, pull_request]
jobs:
run_test_site:
name: py${{ matrix.PYTHON_VERSION }}${{ matrix.LABEL }}
runs-on: ubuntu-latest
timeout-minutes: 30
env:
MPLBACKEND: agg
PIP_SELECTOR: '[tests]'
PYTEST_ARGS: --pyargs hyperspy_gui_ipywidgets
PYTEST_ARGS_COVERAGE: --cov=. --cov-report=xml
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.9', '3.10', '3.11']
LABEL: [-release, -RnM]
PIP_ARGS: [""]
include:
- PYTHON_VERSION: '3.8'
PIP_ARGS: --pre
LABEL: -pre_release-RnM
- PYTHON_VERSION: '3.12'
LABEL: -minimum
- PYTHON_VERSION: '3.12'
LABEL: -RnM
steps:
- uses: actions/checkout@v4
- name: Fetch tags upstream
if: ${{ github.repository_owner != 'hyperspy' }}
# Needs to fetch the tags from upstream to get the
# correct version with setuptools_scm
run: |
git remote add upstream https://github.com/hyperspy/hyperspy_gui_ipywidgets.git
git fetch --prune --unshallow
git fetch upstream --tags
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Display version
run: |
python --version
pip --version
- name: Install HyperSpy (RELEASE_next_major)
if: contains( matrix.LABEL, 'RnM')
run: |
pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_major
- name: Install HyperSpy (RELEASE_next_patch)
if: contains( matrix.LABEL, 'RnP')
run: |
pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_patch
- name: Install exSpy
if: ${{ ! contains( matrix.LABEL, 'minimum') }}
run: |
pip install git+https://github.com/hyperspy/exspy.git
- name: Install
run: |
pip install ${{ matrix.PIP_ARGS }} .'${{ env.PIP_SELECTOR }}'
- name: Run test suite
run: |
pytest ${{ env.PYTEST_ARGS }} ${{ env.PYTEST_ARGS_COVERAGE }}
- name: Upload coverage to Codecov
if: ${{ always() }} && ${{ env.PYTEST_ARGS_COVERAGE }}
uses: codecov/codecov-action@v3