forked from micasense/imageprocessing
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.68 KB
/
Copy pathpython-test.yml
File metadata and controls
60 lines (57 loc) · 1.68 KB
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
name: Unit tests
on:
workflow_call:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
test:
needs: [lint]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12", "3.14"]
steps:
- uses: actions/checkout@v7
with:
lfs: true
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get -qq install exiftool libgdal-dev libzbar0t64
- name: Install gdal python bindings
run: |
GDAL_VERSION=$(gdal-config --version)
pip install -U setuptools wheel numpy
pip install --no-cache-dir --no-build-isolation "gdal==${GDAL_VERSION}"
- name: Install package and test dependencies
run: pip install -e ".[test]"
- name: Test with pytest
run: pytest
- uses: actions/upload-artifact@v7
if: ${{ matrix.python-version == '3.12' }}
with:
name: coverage-report
path: coverage.xml