Skip to content

jgrss/torch20

jgrss/torch20 #313

Workflow file for this run

# 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
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip # caching pip dependencies based on changes to pyproject.toml
- name: Install GDAL binaries
run: |
# Temporary? dpkg fix: https://askubuntu.com/questions/1276111/error-upgrading-grub-efi-amd64-signed-special-device-old-ssd-does-not-exist
sudo rm /var/cache/debconf/config.dat
sudo dpkg --configure -a
# Install GDAL
sudo apt update && sudo apt upgrade -y && sudo apt install -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt install libmysqlclient-dev default-libmysqlclient-dev -y
sudo apt install gdal-bin libgdal-dev libgl1 libspatialindex-dev g++ -y
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
export LD_LIBRARY_PATH=/usr/local/lib
- name: Install Python packages
run: |
# Install Python GDAL
pip install -U pip
pip install -U setuptools wheel
pip install -U numpy==1.24.4
pip install setuptools==57.5.0
GDAL_VERSION=$(gdal-config --version | awk -F'[.]' '{print $1"."$2"."$3}')
pip install GDAL==$GDAL_VERSION --no-binary=gdal
- name: Install PyTorch
run: |
TORCH_CPU="https://download.pytorch.org/whl/cpu"
TORCH_VERSION="2.2.2"
pip install -U --no-cache-dir setuptools>=65.5.1
pip install torch==${TORCH_VERSION} torchvision==0.17.2 torchaudio==${TORCH_VERSION} --extra-index-url $TORCH_CPU
pip install natten==0.17.1+torch220cpu -f https://shi-labs.com/natten/wheels
- name: Install cultionet
run: |
pip install .
- name: Pytest
run: |
pip install pytest
cd tests/
python -m pytest