-
Notifications
You must be signed in to change notification settings - Fork 85
152 lines (134 loc) · 4.1 KB
/
tests-conda.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Tests
on:
workflow_dispatch:
pull_request:
branches:
- dev
- master
push:
branches:
- dev
- master
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.8, 3.9]
timeout-minutes: 60 # add a timeout
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
shell: bash -l {0}
run: |
sudo apt-get update
sudo apt-get install openslide-tools
sudo apt-get install pandoc
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: false
activate-environment: pathml
environment-file: environment.yml
mamba-version: "*"
python-version: ${{ matrix.python-version }}
- name: Debugging
run: |
echo "Printing the environment.yml file..."
cat environment.yml
echo "Checking the status of mamba..."
mamba --version
echo "Checking the available disk space..."
df -h
- name: Install dependencies with mamba
shell: bash -l {0}
run: mamba env update --file environment.yml --name pathml
- name: Conda info
shell: bash -l {0}
run: |
conda info
conda list
- name: Set default Temurin JDK 17
run: |
sudo update-java-alternatives --set temurin-17-jdk-amd64 || true
java -version
- name: Install PathML
shell: bash -l {0}
run: pip install -e .
- name: Install python-spams
shell: bash -l {0}
run: pip install spams
- name: disk usage
shell: bash -l {0}
run: |
sudo df -h
sudo du -h
# - name: Check Coverage Command
# run: |
# which coverage
# coverage --version
# - name: Test with pytest for tile_stitcher
# run: |
# java -version
# python -m pytest tests/preprocessing_tests/test_tilestitcher.py
# - name: Test with pytest and generate coverage report
# shell: bash -l {0}
# run: |
# coverage run -m pytest -m "not slow and not exclude"
# coverage xml
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# env_vars: OS,PYTHON
# fail_ci_if_error: true
# files: ./coverage.xml
# name: codecov-umbrella
# verbose: true
- name: Test other modules with pytest and generate coverage
shell: bash -l {0}
run: |
COVERAGE_FILE=.coverage_others coverage run -m pytest -m "not slow and not exclude"
- name: Test tile_stitcher with pytest and generate coverage
shell: bash -l {0}
run: |
COVERAGE_FILE=.coverage_tilestitcher coverage run -m pytest tests/preprocessing_tests/test_tilestitcher.py
- name: List Files in Directory
shell: bash -l {0}
run: |
ls -la
- name: Combine Coverage Data
shell: bash -l {0}
run: |
coverage combine .coverage_tilestitcher .coverage_others
- name: Generate Combined Coverage Report
shell: bash -l {0}
run: |
coverage xml -o combined_coverage.xml
# - name: Combine coverage data
# shell: bash -l {0}
# run: |
# coverage combine coverage_tilestitcher.xml coverage_others.xml
# coverage xml -o coverage_combined.xml
- name: Upload combined coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./combined_coverage.xml
name: codecov-umbrella
verbose: true
- name: Compile docs
shell: bash -l {0}
run: |
cd docs
pip install -r readthedocs-requirements.txt
make html