From f585da7d8b7071f2bbf00ce7a010cfdb839c5522 Mon Sep 17 00:00:00 2001 From: Gregory Halverson Date: Sat, 28 Sep 2024 15:02:37 -0700 Subject: [PATCH] setting up continuous integration --- .github/workflows/ci.yml | 34 +++++++++++++++++++++++++++++ README.md | 2 ++ pyproject.toml | 6 +++++ tests/test_import_sentinel_tiles.py | 2 ++ 4 files changed, 44 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 tests/test_import_sentinel_tiles.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5a6cc51 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.11] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 # This is already the latest version + + - name: Set up Python + uses: actions/setup-python@v4 # This is also the latest version + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install .[dev] # Use dev to install pytest + + - name: Run tests + run: | + pytest diff --git a/README.md b/README.md index a94356e..dca81b5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # `sentinel_tiles` Python Package +![CI](https://github.com/JPL-Evapotranspiration-Algorithms/sentinel_tiles/actions/workflows/ci.yml/badge.svg) + The `sentinel_tiles` Python package generates raster geometries for the Sentinel version of 100km Military Grid Reference System (MGRS) tiles. The Julia equivalent of this package is [SentinelTiles.jl](https://github.com/STARS-Data-Fusion/SentinelTiles.jl). diff --git a/pyproject.toml b/pyproject.toml index 54f00b0..3637942 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,5 +27,11 @@ dependencies = [ requires-python = ">=3.11" +[project.optional-dependencies] +dev = [ + "pytest>=6.0", + "pytest-cov", # For test coverage reports (optional) +] + [tool.setuptools.package-data] sentinel_tiles = ["*.txt", "*.geojson"] diff --git a/tests/test_import_sentinel_tiles.py b/tests/test_import_sentinel_tiles.py new file mode 100644 index 0000000..35414f5 --- /dev/null +++ b/tests/test_import_sentinel_tiles.py @@ -0,0 +1,2 @@ +def test_import_sentinel_tiles(): + import sentinel_tiles