forked from Inria-Empenn/narps_open_pipelines
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.4 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
## Disclaimer - This GitHub Actions workflow runs all the unit tests for the project.
# Name the workflow
name: unit_testing
# Define when it runs
on:
push:
paths:
- 'narps_open/**'
- 'setup.py'
- 'setup.cfg'
- 'pytest.ini'
- 'tests/conftest.py'
pull_request:
paths:
- 'narps_open/**'
- 'setup.py'
- 'setup.cfg'
- 'pytest.ini'
- 'tests/conftest.py'
# Jobs that define the workflow
jobs:
# Name of the job running unit tests
pytest:
# Define the runner for this job
runs-on: self-hosted
# Steps that define the job
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Load configuration for self-hosted runner
run: cp /home/neuro/local_testing_config.toml narps_open/utils/configuration/testing_config.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[tests]
- name: Launch tests with pytest & get code coverage
run: |
coverage run -m pytest --junit-xml=pytest_report.xml -m "not pipeline_test"
coverage report
coverage xml
- name: Archive pytest results
if: ${{ failure() }} # Run only if previous job fails
uses: actions/upload-artifact@v3
with:
name: unit_tests-reports
path: |
pytest_report.xml
coverage.xml
retention-days: 15