forked from Dana-Farber-AIOS/pathml
-
Notifications
You must be signed in to change notification settings - Fork 0
273 lines (228 loc) · 8.61 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: Tests Cross-Platform
on:
workflow_dispatch:
pull_request:
branches:
- dev
- master
push:
branches:
- dev
- master
jobs:
build:
runs-on: windows-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.9]
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
id: setup-java
- name: Debug JAVA_HOME
run: |
echo $env:JAVA_HOME
echo $env:PATH
shell: pwsh
- name: Set JDK_HOME environment variable
run: echo "JDK_HOME=${JAVA_HOME}" >> $GITHUB_ENV
shell: bash
- name: Print JAVA_HOME and JDK_HOME
run: |
echo "JAVA_HOME: $env:JAVA_HOME"
echo "JDK_HOME: $env:JDK_HOME"
shell: pwsh
- name: Download and Setup OpenSlide
run: |
$zipFile = "openslide-win64-20231011.zip"
$extractPath = Join-Path $env:GITHUB_WORKSPACE "openslide-binaries"
Invoke-WebRequest -Uri "https://github.com/openslide/openslide-bin/releases/download/v20231011/$zipFile" -OutFile $zipFile
Expand-Archive -Path $zipFile -DestinationPath $extractPath
$binPath = Join-Path $extractPath "openslide-win64-20231011/bin"
Write-Host "Adding to PATH: $binPath"
echo "OPENSLIDE_PATH=$binPath" | Out-File -Append -FilePath $env:GITHUB_ENV
echo "$binPath" | Out-File -Append -FilePath $env:GITHUB_PATH
shell: pwsh
# Optional: List files in OpenSlide bin directory to verify
- name: List files in OpenSlide bin directory
run: |
Get-ChildItem -Path $env:OPENSLIDE_PATH
shell: pwsh
env:
OPENSLIDE_PATH: ${{ env.OPENSLIDE_PATH }}
# - name: Download and Setup OpenSlide
# run: |
# Invoke-WebRequest -Uri "https://github.com/openslide/openslide-bin/releases/download/v20231011/openslide-win64-20231011.zip" -OutFile "openslide-win64-20231011.zip"
# # Expand-Archive -Path "openslide-win64-20231011.zip" -DestinationPath "${{ github.workspace }}/openslide-binaries"
# # echo "${{ github.workspace }}/openslide-binaries/openslide-win64-20231011" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# shell: pwsh
# - name: Extract OpenSlide Binaries
# run: |
# Expand-Archive -Path "openslide-win64-20231011.zip" -DestinationPath "${{ github.workspace }}/openslide-binaries"
# $binPath = Join-Path ${{ github.workspace }} "openslide-binaries/openslide-win64-20231011/bin"
# Write-Host "Adding to PATH: $binPath"
# echo "$binPath" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# shell: pwsh
# - name: List files in OpenSlide bin directory
# run: |
# $binPath = Join-Path ${{ github.workspace }} "openslide-binaries/openslide-win64-20231011/bin"
# Get-ChildItem -Path $binPath
# shell: pwsh
- name: Check PATH
run: |
# echo $env:JAVA_HOME
echo $env:PATH
shell: pwsh
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: false
activate-environment: pathml
environment-file: '.github/ci-environments/env-py39.yml'
mamba-version: "*"
python-version: ${{ matrix.python-version }}
- name: Debugging
shell: bash -l {0}
run: |
echo "Checking the status of mamba..."
mamba --version
echo "Checking the available disk space..."
df -h
- name: Conda info
shell: bash -l {0}
run: |
conda info
conda list
- name: Install PathML
shell: bash -l {0}
run: pip install -e .
- name: Install torchvision
shell: bash -l {0}
run: pip install torchvision==0.14.1
# - name: Download and Setup OpenSlide
# run: |
# Invoke-WebRequest -Uri "https://github.com/openslide/openslide-bin/releases/download/v20231011/openslide-win64-20231011.zip" -OutFile "openslide-win64-20231011.zip"
# Expand-Archive -Path "openslide-win64-20231011.zip" -DestinationPath "${{ github.workspace }}/openslide-binaries"
# echo "${{ github.workspace }}/openslide-binaries/openslide-win64-20231011" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# shell: pwsh
- name: Set OPENSLIDE_PATH
run: echo "OPENSLIDE_PATH=D:\a\pathml\pathml\openslide-binaries\openslide-win64-20231011\bin" >> $GITHUB_ENV
shell: pwsh
- name: Check PATH
run: |
# echo $env:JAVA_HOME
echo $env:PATH
shell: pwsh
- name: Test tile_stitcher with pytest and generate coverage
shell: bash -l {0}
run: |
coverage run --data-file=.coverage_tilestitcher -m pytest tests/preprocessing_tests/test_tilestitcher.py
continue-on-error: true
- name: Test other modules with pytest and generate coverage
shell: bash -l {0}
run: |
coverage run --data-file=.coverage_others -m pytest -m "not slow and not exclude"
continue-on-error: true
# name: Tests Cross-Platform
# on:
# workflow_dispatch:
# pull_request:
# branches:
# - dev
# - master
# push:
# branches:
# - dev
# - master
# jobs:
# build:
# runs-on: windows-latest # Use Ubuntu if you're building on Linux, or keep windows-latest if you're targeting Windows.
# strategy:
# max-parallel: 5
# matrix:
# python-version: [3.9]
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v2
# - name: Set up JDK 17
# uses: actions/setup-java@v2
# with:
# java-version: '17'
# distribution: 'temurin' # Use 'temurin' for Eclipse Temurin distribution
# id: setup-java
# - name: Debug JAVA_HOME
# run: |
# echo $env:JAVA_HOME
# echo $env:PATH
# shell: pwsh
# - name: Set JDK_HOME environment variable
# shell: bash
# run: echo "JDK_HOME=${JAVA_HOME}" >> $GITHUB_ENV
# - name: Print JAVA_HOME and JDK_HOME
# run: |
# echo "JAVA_HOME: $env:JAVA_HOME"
# echo "JDK_HOME: $env:JDK_HOME"
# shell: pwsh
# - name: vcpkg build
# uses: johnwason/vcpkg-action@v6
# id: vcpkg
# with:
# pkgs: openslide
# triplet: x64-windows
# token: ${{ github.token }}
# github-binarycache: true
# - name: Setup Miniconda
# uses: conda-incubator/setup-miniconda@v2
# with:
# auto-activate-base: false
# activate-environment: pathml
# environment-file: '.github/ci-environments/env-py39.yml' # Directly specify the env-py39.yml file
# mamba-version: "*"
# python-version: ${{ matrix.python-version }}
# - name: Debugging
# shell: bash -l {0}
# run: |
# echo "Checking the status of mamba..."
# mamba --version
# echo "Checking the available disk space..."
# df -h
# - name: Conda info
# shell: bash -l {0}
# run: |
# conda info
# conda list
# - name: Install PathML
# shell: bash -l {0}
# run: pip install -e .
# # - name: Install python-spams
# # shell: bash -l {0}
# # run: pip install spams
# - name: Install torchvision
# shell: bash -l {0}
# run: pip install torchvision==0.14.1
# - name: Set up vcpkg
# uses: lukka/run-vcpkg@v10
# with:
# # Setup vcpkg directory
# vcpkgDirectory: '${{ github.workspace }}/vcpkg'
# # Clone vcpkg repo
# setupOnly: true
# - name: Install OpenSlide with vcpkg
# run: |
# ./vcpkg/vcpkg install openslide
# working-directory: ${{ github.workspace }}
# - 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
# coverage run --data-file=.coverage_tilestitcher -m pytest tests/preprocessing_tests/test_tilestitcher.py
# - name: Test other modules with pytest and generate coverage
# shell: bash -l {0}
# run: coverage run --data-file=.coverage_others -m pytest -m "not slow and not exclude"
# # COVERAGE_FILE=.coverage_others coverage run -m pytest -m "not slow and not exclude"