name: PyRate CI on: pull_request: branches: - 'master' push: branches: - '**' jobs: build: if: ${{ ! (contains(github.event.head_commit.message, 'ci skip') || contains(github.event.head_commit.message, 'skip ci'))}} runs-on: ubuntu-18.04 name: Python ${{ matrix.python }} strategy: matrix: include: - build: 1 python-version: "3.7" GDALVERSION: "3.0.2" PROJVERSION: "6.2.1" - build: 2 python-version: "3.7" GDALVERSION: "3.0.4" PROJVERSION: "6.1.1" - build: 3 python-version: "3.8" GDALVERSION: "3.0.4" PROJVERSION: "6.1.1" - build: 4 python-version: "3.9" GDALVERSION: "3.0.4" PROJVERSION: "6.3.2" env: PIP_WHEEL_DIR: "/home/runner/.cache/pip/wheels" PIP_FIND_LINKS: "file:///home/runner/.cache/pip/wheels" GDALINST: "/home/runner/gdalinstall" GDALBUILD: "/home/runner/gdalbuild" GDALVERSION: ${{ matrix.GDALVERSION }} PROJINST: "/home/runner/gdalinstall" PROJBUILD: "/home/runner/projbuild" PROJVERSION: ${{ matrix.PROJVERSION }} PYTHONVERSION: ${{ matrix.python-version }} steps: - uses: actions/checkout@v2 - name: Cache multiple paths uses: actions/cache@v2 with: path: | /home/runner/gdalinstall key: ${{ runner.os }}-cache-GDAL-${{ matrix.GDALVERSION }}-proj-${{ matrix.PROJVERSION }} - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Common set up ${{ matrix.python-version }} run: | sudo apt update sudo apt upgrade python -m pip install -U pip wheel setuptools==58.0 - name: Install packages including openmpi if: env.PYTHONVERSION != '3.9' run: sudo apt install libhdf5-serial-dev libnetcdf13 libatlas-base-dev gfortran openmpi-bin libopenmpi-dev - name: Install packages except openmpi libraries if: env.PYTHONVERSION == '3.9' run: sudo apt install libhdf5-serial-dev libnetcdf13 libatlas-base-dev gfortran - name: Install proj ${{matrix.PROJVERSION}} run: | echo "PATH=$GDALINST/gdal-$GDALVERSION/bin:$PATH" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$GDALINST/gdal-$GDALVERSION/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV source ./scripts/ci_proj_install.sh - name: Install GDAL ${{matrix.GDALVERSION}} run: | echo "GDAL_DATA=$GDALINST/gdal-$GDALVERSION/share/gdal" >> $GITHUB_ENV echo "PROJ_LIB=$GDALINST/gdal-$GDALVERSION/share/proj" >> $GITHUB_ENV echo "LDFLAGS=-L$GDALINST/gdal-$GDALVERSION/lib -Wl,-rpath,$GDALINST/gdal-$GDALVERSION/lib" >> $GITHUB_ENV source ./scripts/ci_gdal_install.sh - name: Python ${{ matrix.python-version }} with MPI if: env.PYTHONVERSION != '3.9' run: | python setup.py install rm -rf Py_Rate.egg-info # remove the local egg echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV chmod 444 tests/test_data/small_test/tif/geo_070709-070813_unw.tif # makes the file readonly, used in a test pip install -r requirements-dev.txt -r requirements-test.txt - name: Python ${{ matrix.python-version }} without MPI if: env.PYTHONVERSION == '3.9' run: | python setup.py install rm -rf Py_Rate.egg-info # remove the local egg echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV chmod 444 tests/test_data/small_test/tif/geo_070709-070813_unw.tif # makes the file readonly, used in a test pip install -r requirements-test.txt - name: Test Pyrate in Python ${{ matrix.python-version }} with MPI if: env.PYTHONVERSION != '3.9' run: | pytest tests/ -m "slow" mpirun -n 3 pytest tests/test_shared.py -k test_tiles_split -s pytest --cov-config=.coveragerc --cov-report term-missing:skip-covered --cov=pyrate tests/ -m "not slow" env: OMP_NUM_THREADS: 1 - name: Test Pyrate in Python ${{ matrix.python-version }} without MPI if: env.PYTHONVERSION == '3.9' run: | pytest tests/ -m "not mpi and slow" pytest --cov-config=.coveragerc --cov-report term-missing:skip-covered --cov=pyrate tests/ -m "not slow and not mpi" env: OMP_NUM_THREADS: 1