Skip to content

Commit

Permalink
ci: refine actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dfguerrerom committed May 29, 2024
1 parent 894b5c4 commit b1e9535
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
- push
- workflow_dispatch

env:
EARTHENGINE_TOKEN: ${{ secrets.EARTHENGINE_TOKEN }}
PLANET_API_KEY: ${{ secrets.PLANET_API_KEY }}

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -13,12 +17,14 @@ jobs:
with:
python-version: "3.8"
- uses: pre-commit/[email protected]
- name: install dependencies
- name: Install module venv
run: |
python -m pip install --find-links=https://girder.github.io/large_image_wheels GDAL
python -m pip install earthengine-api
python -m pip install -r requirements.txt
python -m pip install pytest nbmake
python -m pip install "git+https://github.com/12rambau/sepal_ui.git@sepal_pre_release"
module_venv --venv_prefix venv
- name: Activate venv
run: source ~/module-venv/clip-time-series/bin/activate
- name: install nbmake
run: python -m pip install pytest nbmake
- name: build the application
run: pytest --nbmake ui.ipynb
test:
Expand All @@ -29,9 +35,11 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install sepal_ui
run: python -m pip install "git+https://github.com/12rambau/sepal_ui.git@sepal_pre_release"
- name: Build with sepal_ui venv
run: module_venv
- name: Install module venv
run: |
python -m pip install "git+https://github.com/12rambau/sepal_ui.git@sepal_pre_release"
module_venv --venv_prefix venv
- name: Activate venv
run: source ~/module-venv/clip-time-series/bin/activate
- name: run tests
run: python -m pytest tests/ --v -s
run: python -m pytest test/
4 changes: 2 additions & 2 deletions component/scripts/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from math import sqrt
from typing import Union
from typing import List, Union

import ee
import geopandas as gpd
Expand Down Expand Up @@ -115,7 +115,7 @@ def enhance_band(band: np.array, adjustment_type: AdjustmentType) -> np.array:

def get_buffers(
gdf: gpd.GeoDataFrame, size: int, gee: bool = False
) -> Union[gpd.GeoDataFrame, list[ee.Geometry]]:
) -> Union[gpd.GeoDataFrame, List[ee.Geometry]]:
"""Get the buffers of the geometries in the gdf."""

geometry = gdf.copy()
Expand Down

0 comments on commit b1e9535

Please sign in to comment.