-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (66 loc) · 2.58 KB
/
unit_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
# This workflow will install Python dependencies and run tests for a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Unit tests
on:
push:
branches:
- develop
- develop-ref
- feature_*
- main_*
- bugfix_*
- test_*
paths-ignore:
- 'docs/**'
- '.github/pull_request_template.md'
- '.github/ISSUE_TEMPLATE/**'
- '**/README.md'
- '**/LICENSE.md'
pull_request:
types: [opened, reopened, synchronize]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# try installing scikit-image explicitly. Using requirements.txt versions doesn't seem to build correctly
python -m pip install -U scikit-image
# install the coverage.py code coverage tool
python3 -m pip install coverage
- name: Test with pytest
# these are tests that don't have external dependencies (i.e. need to run on Linux test hosts where large datasets reside or require exact machine type for
# image comparisons to work, etc.)
run: |
cd test
pytest test_agg_eclv.py
pytest test_agg_stats_and_boot.py
pytest test_agg_stats_with_groups.py
pytest test_calc_difficulty_index.py
pytest test_convert_lon_indices.py
pytest test_ctc_statistics.py
pytest test_event_equalize.py
pytest test_event_equalize_against_values.py
pytest test_lon_360_to_180.py
pytest test_statistics.py
pytest test_tost_paired.py
pytest test_utils.py
pytest test_validate_mv_python.py
pytest test_future_warnings.py
coverage run -m pytest test_agg_eclv.py test_agg_stats_and_boot.py test_agg_stats_with_groups.py test_calc_difficulty_index.py test_convert_lon_indices.py test_event_equalize.py test_event_equalize_against_values.py test_lon_360_to_180.py test_statistics.py test_tost_paired.py test_utils.py test_future_warnings.py
coverage html
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: test/htmlcov/index.html