-
Notifications
You must be signed in to change notification settings - Fork 79
69 lines (61 loc) · 2.97 KB
/
python-test.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI-PyTest
on:
push:
branches: [master]
pull_request: {}
jobs:
full-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Call reusable workflow to install dependencies
id: dependencies
uses: ./.github/workflows/dependencies
- name: Run generic unit tests
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml -k "generic"
- name: Run classification unit tests with histology
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml --cov-append -k "classification and histology"
- name: Run classification unit tests
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml --cov-append -k "classification and not histology"
- name: Run segmentation unit tests
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml --cov-append -k "segmentation and not transunet"
- name: Run regression unit tests
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml --cov-append -k "regression"
- name: Run transunet unit tests
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml --cov-append -k "transunet"
- name: Run entrypoints tests
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml --cov-append -k "entrypoints"
- name: Run test for update_version
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
run: |
pytest --cov=. --cov-report=xml --cov-append -k "update_version"
- name: Upload coverage
if: ${{steps.dependencies.outputs.other_modified_files_count > 0}} # Run on any non-docs change
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
- name: Upload coverage to Codacy
if: github.ref == 'refs/heads/master' # only run when on master
uses: codacy/[email protected]
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage.xml