-
Notifications
You must be signed in to change notification settings - Fork 8
102 lines (86 loc) · 3.21 KB
/
run_tests.yaml
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
name: Tests with Spark
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-14
# - windows-latest
python:
- '3.10'
- '3.11'
- '3.12'
spark:
- 3.4.0
- 3.5.2
name: ${{ matrix.os }} Python ${{ matrix.python }} Spark ${{ matrix.spark }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: temurin
# Download and install ANTs
- name: Install ANTs
if: startsWith(matrix.os, 'ubuntu')
run: |
wget https://github.com/ANTsX/ANTs/releases/download/v2.5.3/ants-2.5.3-ubuntu-20.04-X64-gcc.zip
unzip ants-2.5.3-ubuntu-20.04-X64-gcc.zip -d $HOME/
rm ants-2.5.3-ubuntu-20.04-X64-gcc.zip
echo "ANTs installed successfully"
- name: Install ANTs on macOS
if: startsWith(matrix.os, 'macos')
run: |
curl -L -o $HOME/ants-2.5.3-macos-14-ARM64-clang.zip https://github.com/ANTsX/ANTs/releases/download/v2.5.3/ants-2.5.3-macos-14-ARM64-clang.zip
unzip $HOME/ants-2.5.3-macos-14-ARM64-clang.zip -d $HOME/
rm $HOME/ants-2.5.3-macos-14-ARM64-clang.zip
echo "ANTs installed successfully on macOS"
# - name: Install ANTs on Windows
# if: startsWith(matrix.os, 'windows')
# run: |
# Invoke-WebRequest -Uri https://github.com/ANTsX/ANTs/releases/download/v2.5.3/ants-2.5.3-windows-2022-X64-VS2019.zip -OutFile $env:USERPROFILE\\ants-2.5.3-windows-2022-X64-VS2019.zip
# Expand-Archive -Path $env:USERPROFILE\\ants-2.5.3-windows-2022-X64-VS2019.zip -DestinationPath $env:USERPROFILE\\ants-2.5.3
# Remove-Item $env:USERPROFILE\\ants-2.5.3-windows-2022-X64-VS2019.zip
# echo "ANTs installed successfully on Windows"
# Install voluseg and dependencies
- name: Install voluseg
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt --no-cache-dir
pip install .[pyspark] --no-cache-dir
# Tests and coverage
- name: Clear previous coverage data
run: coverage erase
- name: Run tests with pytest on Unix-like systems
if: ${{ !startsWith(matrix.os, 'windows') }}
env:
ANTS_PATH: "$HOME/ants-2.5.3/bin"
run: |
coverage run -m pytest -s -v --tb=short
# - name: Run tests with pytest on Windows
# if: startsWith(matrix.os, 'windows')
# env:
# ANTS_PATH: "%USERPROFILE%/ants-2.5.3/bin"
# run: |
# pytest --cov=voluseg --cov-report=term-missing --cov-report=html --cov-report=xml -s -v --tb=short
- name: Generate coverage report
run: coverage report -m
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}