Dev #157
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests with Spark | |
on: | |
push: | |
branches: | |
- master | |
- spark-memory | |
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 }} | |