-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (60 loc) · 2.3 KB
/
pytest.yml
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
name: Pytest
on:
- pull_request
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
python-version: ['3.11', '3.10'] #, '3.9', '3.8', '3.7', '3.6']
gdal-version: ['3.4'] #, '3.6'] TODO: gdal 3.6 is still unstable.
exclude:
- os: ubuntu-22.04
python-version: '3.6'
- 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
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 .