testing the matrix for legacy versions #588
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: Pytest | |
on: | |
- pull_request | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-20.04] # no ubuntugis @ ubuntu-24.04 | |
python-version: ['3.11', '3.10', '3.9', '3.8', '3.7'] # , '3.6'] <- 3.6 needs setup.cfg | |
gdal-version: ['3.4', '3.6'] | |
exclude: | |
- os: ubuntu-24.04 | |
python-version: '3.8' | |
- os: ubuntu-24.04 | |
python-version: '3.7' | |
- os: ubuntu-24.04 | |
gdal-version: '3.4' | |
- os: ubuntu-22.04 | |
gdal-version: '3.4' | |
- os: ubuntu-20.04 | |
python-version: '3.11' | |
- os: ubuntu-20.04 | |
gdal-version: '3.6' | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} 🐍 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: install gdal | |
id: gdal | |
run: | | |
if [ "${{ matrix.os }}" = "ubuntu-20.04" ] | |
then | |
echo adding ubuntugis unstable | |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable | |
else | |
echo adding ubuntugis stable | |
sudo apt-add-repository ppa:ubuntugis/ppa | |
fi | |
echo test if this still works | |
sudo apt-get update | |
echo available python3-gdal versions: $(apt-cache madison python3-gdal | cut -f2 -d "|" | tr -d " ") | |
echo available libgdal-dev versions: $(apt-cache madison libgdal-dev | cut -f2 -d "|" | tr -d " ") | |
export APT_GDAL_VERSION=$(apt-cache madison python3-gdal | grep ${{ matrix.gdal-version }} | head -n1 | cut -f2 -d "|" | tr -d " ") | |
echo "using version ->${APT_GDAL_VERSION}<-" | |
apt-cache madison libgdal30 | grep "${APT_GDAL_VERSION}" && sudo apt-get install libgdal30="${APT_GDAL_VERSION}" | |
sudo apt-get install python3-gdal="${APT_GDAL_VERSION}" libgdal-dev="${APT_GDAL_VERSION}" | |
echo gdal_version=$(echo "${APT_GDAL_VERSION}" | cut -f1 -d '+') >> $GITHUB_OUTPUT | |
- name: Install dependencies for test | |
run: | | |
python -m pip install --upgrade pip wheel | |
python -m pip install setuptools==57.* | |
python -m pip freeze | |
- name: Install dependencies from config | |
run: | | |
# we need to pin GDAL here to match the python3-gdal | |
pip install GDAL==${{steps.gdal.outputs.gdal_version}} | |
pip3 install --no-cache-dir .[test] | |
- name: Test with pytest | |
run: | | |
pytest -vv | |
- name: Test with black | |
run: | | |
black --check . |