-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from urbangrammarai/feature/test-automation
Add CI testing of unittests and linting
- Loading branch information
Showing
84 changed files
with
3,070 additions
and
1,820 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
ignore = E203 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Unit tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
# Run on main because caches are inherited from parent branches | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.7"] | ||
|
||
# Set default shell to allow conda activate env to be passed from one step to the next | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Miniconda with Python ${{ matrix.python-version }} | ||
uses: conda-incubator/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: environment.yml | ||
clean-patched-environment-file: false | ||
- name: Check Conda configuration | ||
run: | | ||
conda info -a | ||
python --version | ||
- name: Install repo using pip | ||
run: | | ||
python -m pip install . | ||
- name: Test with pytest | ||
run: | | ||
# Limit to just the most problematic test during debugging | ||
pytest --durations=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
# Adapted from https://github.com/alan-turing-institute/Python-quality-tools | ||
name: pre-commit action | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
# Run on main because caches are inherited from parent branches | ||
env: | ||
# This should be the default but we'll be explicit | ||
PRE_COMMIT_HOME: ~/.caches/pre-commit | ||
jobs: | ||
pre-commit_job: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.7" | ||
- name: Install Pre-Commit | ||
shell: bash | ||
run: | | ||
python -m pip install pre-commit | ||
- name: Cache Pre-Commit Hooks | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.PRE_COMMIT_HOME }} | ||
key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Install Pre-Commit Hooks | ||
shell: bash | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
pre-commit install-hooks | ||
- name: Run Pre-Commit Hooks | ||
shell: bash | ||
run: | | ||
pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
# Ignore RVeg and Notebooks for now | ||
exclude: (^rveg|^notebooks|^binder) | ||
default_language_version: | ||
# force all unspecified python hooks to run python3 | ||
python: python3.7 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-xml | ||
- id: check-added-large-files | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
exclude: (^pyveg/configs|^pyveg/zenodo_config_template.py|^pyveg/azure_config_template.py) | ||
- repo: https://github.com/pre-commit/mirrors-autopep8 | ||
rev: 'v1.6.0' # Use the sha / tag you want to point at | ||
hooks: | ||
- id: autopep8 | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black", "--filter-files"] | ||
|
||
# Ignore type checking for now, as this would require non-trival change to the code | ||
# in order to pass `mypy` tests | ||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: 'v0.960' # Use the sha / tag you want to point at | ||
# hooks: | ||
# - id: mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include pyveg/testdata/* | ||
include pyveg/testdata/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ earthengine-api==0.1.210 | |
geetools | ||
pillow | ||
imageio | ||
opencv-python | ||
opencv-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: gee_pipeline | ||
channels: | ||
- defaults | ||
- conda-forge | ||
dependencies: | ||
- python=3.7 | ||
- earthengine-api | ||
- rasterio | ||
- coverage |
Oops, something went wrong.