Skip to content

Add method to image #59

Add method to image

Add method to image #59

Workflow file for this run

name: Unit Tests
on:
pull_request:
types: [opened, reopened, edited, assigned, synchronize]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.9
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: true
python-version: 3.9
- name: Conda create environemnt
shell: bash -l {0}
run: conda create --name gk
- name: Conda activate
shell: bash -l {0}
run: conda activate gk
- run: |
conda install -c conda-forge --yes --freeze-installed xesmf cartopy psycopg2 'bokeh>=2.4.2,<3' pandas=1.4.3 netCDF4 scipy xarray=2022.6.0
- run: |
conda run pip install geopandas
- run: conda run pip install pytest-github-actions-annotate-failures
- run: |
conda run python setup.py install
- run: |
conda run pip install black==22.3.0
- name: Check formatting in `tests` catalog
run: conda run black -l 79 --preview tests
- name: Check formatting in `geokube` catalog
run: conda run black -l 79 --preview geokube
- name: Check for modified files
id: git-check
run: echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
- name: Verify code formatting
if: steps.git-check.outputs.modified == 'true'
uses: actions/github-script@v3
with:
script: |
core.setFailed('`geokube` or `tests` directory is not well formatted! Use command `black -l 79 --preview geokube` and `black -l 79 --preview tests`')
- name: Run pytest
run: conda run pytest tests