-
Notifications
You must be signed in to change notification settings - Fork 11
142 lines (135 loc) · 5.17 KB
/
ci.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
path: |
~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install GDAL binaries
run: |
sudo apt update && sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ubuntugis/ppa -y
sudo apt update && sudo apt install -y gdal-bin libgdal-dev libgl1 libspatialindex-dev g++ libmysqlclient-dev
echo "CPLUS_INCLUDE_PATH=/usr/include/gdal" >> $GITHUB_ENV
echo "C_INCLUDE_PATH=/usr/include/gdal" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/lib" >> $GITHUB_ENV
- name: Install Python packages
run: |
pip install -U pip setuptools wheel
pip install numpy
GDAL_VERSION=$(gdal-config --version | awk -F'[.]' '{print $1"."$2}')
echo "GDAL Version: $GDAL_VERSION"
pip install arosics GDAL==$GDAL_VERSION --no-cache-dir
- name: Install GeoWombat
run: |
pip install ".[stac,web,coreg,perf,tests]"
- name: Print Versions
run: |
echo "$(pip list )"
- name: Run Unittests
run: |
pip install testfixtures
python -m unittest discover -p 'test_*.py'
- name: Run ml Unittests
run: |
pip install testfixtures
pip install ".[ml]"
python -m unittest discover -p 'ml_*.py'
# Quality:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: 3.8
# - name: Install Python Poetry
# uses: abatilo/[email protected]
# with:
# poetry-version: 1.1.13
# - name: Configure poetry
# shell: bash
# run: python -m poetry config virtualenvs.in-project true
# - name: View poetry version
# run: poetry --version
# - name: Install dependencies
# run: |
# python -m poetry install
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# python -m poetry run flake8 . --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# python -m poetry run flake8 . --exclude .venv --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Version:
# needs: Tests
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):')
# runs-on: ubuntu-latest
# concurrency: release
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# token: ${{ secrets.GW_TOKEN }}
# - uses: actions/setup-python@v2
# with:
# python-version: 3.8.12
# - name: Python Semantic Release
# run: |
# pip install -U pip setuptools wheel
# pip install Cython>=0.29.* numpy>=1.19.0
# python -m pip install python-semantic-release
# # Add credentials
# git config user.name "github-actions"
# git config user.email "[email protected]"
# # Bump GeoWombat version
# semantic-release publish
# env:
# GH_TOKEN: ${{ secrets.GW_TOKEN }}
# https://github.com/fnkr/github-action-ghr
# Release:
# needs: Version
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):')
# name: Upload release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: 3.8.12
# token: ${{ secrets.GW_TOKEN }}
# - uses: syphar/restore-virtualenv@v1
# id: cache-gwenv
# with:
# requirement_files: setup.cfg
# - uses: syphar/restore-pip-download-cache@v1
# if: steps.cache-gwenv.outputs.cache-hit != 'true'
# - name: Release version
# uses: fnkr/github-action-ghr@v1
# if: startsWith(github.ref, 'refs/tags/')
# env:
# GHR_PATH: .
# GHR_COMPRESS: gz
# GHR_DELETE: true
# GHR_REPLACE: true
# GITHUB_TOKEN: ${{ secrets.GW_TOKEN }}