-
Notifications
You must be signed in to change notification settings - Fork 32
88 lines (86 loc) · 2.52 KB
/
run_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
# Run and publish MATLAB tests with coverage
name: Run tests
on:
pull_request:
branches:
- master
paths-ignore:
- "*.md"
- "*.codespellrc"
- ".github/**"
push:
branches:
- master
jobs:
run_tests:
name: Run MATLAB tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Configure python env
run: |
python -m pip install -U pip
pip install -r +tests/requirements.txt
echo "HDF5_PLUGIN_PATH=$(python -c "import hdf5plugin; print(hdf5plugin.PLUGINS_PATH)")" >> "$GITHUB_ENV"
echo $( python -m pip show nwbinspector | grep ^Location: | awk '{print $2}' )
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2024a # this is necessary to test dynamic filters
- name: Run tests
uses: matlab-actions/run-command@v2
with:
command: |
pyenv("ExecutionMode", "OutOfProcess");
results = assertSuccess(nwbtest);
assert(~isempty(results), 'No tests ran');
- name: Upload JUnit results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: testResults.xml
retention-days: 1
- name: Upload coverage results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-coverage
path: ./coverage.xml
publish_junit:
name: Publish JUnit test results
runs-on: ubuntu-latest
if: always()
needs: [run_tests]
steps:
- name: Retrieve result files
uses: actions/download-artifact@v4
with:
name: test-results
- name: Publish test results
uses: mikepenz/action-junit-report@v4
with:
report_paths: 'testResults.xml'
publish_coverage:
name: Publish Cobertura test coverage
runs-on: ubuntu-latest
needs: [run_tests]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: retrieve code coverage files
uses: actions/download-artifact@v4
with:
name: test-coverage
- name: Publish on coverage results on Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
name: codecov-matnwb
verbose: true