-
-
Notifications
You must be signed in to change notification settings - Fork 41
69 lines (58 loc) · 1.89 KB
/
unit_tests.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
64
65
66
67
68
69
name: Tests on all platforms with linting
on: [pull_request]
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Python environment
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_additional.txt
pip install -r tests/requirements_tests.txt
- name: Lint with flake8
run: flake8
- name: Check code format with Black
run: black --check .
testing:
needs: linting
runs-on: ${{ matrix.os}}
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
os: [windows-latest, ubuntu-latest]
max-parallel: 20
steps:
- uses: actions/checkout@v3
- name: Set Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_additional.txt
pip install -r tests/requirements_tests.txt
- name: Download spatialite on Linux
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libsqlite3-mod-spatialite
sudo apt install -y libspatialite-dev
pip3 install spatialite
sudo ln -s /usr/lib/x86_64-linux-gnu/mod_spatialite.so /usr/lib/x86_64-linux-gnu/mod_spatialite
- name: Download spatialite on Windows
if: matrix.os == 'windows-latest'
run: python tests/setup_windows_spatialite.py
- name: Compile library
run: |
python setup.py build_ext --inplace
- name: Runs test
run: python -m pytest