Skip to content

Commit

Permalink
feat: Update github actions & lint (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
RanbirAulakh authored Oct 17, 2023
1 parent 8ce7dd5 commit ba1a5fb
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Docs
on: [push, pull_request, workflow_dispatch]
name: Generate and Publish Documentation for OSML Model Runner Test

on:
workflow_call:

permissions:
contents: write

jobs:
docs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -13,14 +18,14 @@ jobs:
pip install sphinx
python -m pip install sphinx-autoapi
python -m pip install sphinx_rtd_theme
python -m pip install tox tox-gh-actions
- name: Sphinx build
run: |
sphinx-build doc _build
tox -e docs
- name: Deploy
uses: peaceiris/[email protected]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
publish_dir: .tox/docs/tmp/html/
force_orphan: true
10 changes: 10 additions & 0 deletions .github/workflows/osml-model-runner-test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "OSML Models Build Workflow"

on:
pull_request:
branches: ["main", "dev"]

jobs:
Build_Validate_Tox:
uses: ./.github/workflows/python-tox.yml
secrets: inherit
14 changes: 14 additions & 0 deletions .github/workflows/osml-model-runner-test-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "OSML Model Runner Test Build and Publish Workflow"

on:
push:
branches: ["main", "dev"]

jobs:
Build_Validate_Tox:
uses: ./.github/workflows/python-tox.yml
secrets: inherit
Publish_Documentation:
needs: [Build_Validate_Tox]
uses: ./.github/workflows/documentation-publish.yml
secrets: inherit
30 changes: 30 additions & 0 deletions .github/workflows/python-tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Build/Validation with Tox

on:
workflow_call:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: 'true'
ssh-key: ${{ secrets.git_ssh_key }}
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Validate package with tox
run: |
# stop the build if there are Python syntax errors or undefined names
tox
2 changes: 1 addition & 1 deletion bin/process_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"tile_png": f"s3://{image_bucket}/tile.png",
"sicd_capella_chip_ntf": f"s3://{image_bucket}/sicd-capella-chip.ntf",
"sicd_umbra_chip_ntf": f"s3://{image_bucket}/sicd-umbra-chip.ntf",
"sicd_interferometric_hh_ntf": f"s3://{image_bucket}/sicd-interferometric-hh.nitf"
"sicd_interferometric_hh_ntf": f"s3://{image_bucket}/sicd-interferometric-hh.nitf",
}

# call into root directory of this package so that we can run this script from anywhere.
Expand Down
7 changes: 7 additions & 0 deletions environment-py311.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: osml_model_runner_test
channels:
- conda-forge
dependencies:
- conda-forge::python=3.11
- conda-forge::gdal=3.7.0
- conda-forge::proj=9.2.1
6 changes: 6 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: osml_model_runner_test
channels:
- conda-forge
dependencies:
- conda-forge::gdal=3.7.0
- conda-forge::proj=9.2.1
10 changes: 6 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = Package to run tests against osml-model-runner deployments.
long_description = file: README.md
long_description_content_type = text/markdown
author = Amazon Web Services
author_email = todo-public-library-poc@amazon.com
author_email = aws-osml-admin@amazon.com
license =
MIT No Attribution

Expand All @@ -24,8 +24,8 @@ license =
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
project_urls =
Source = https://github.com/aws/todo-public-library
Tracker = https://github.com/aws/todo-public-library/issues
Source = https://github.com/aws-solutions-library-samples/osml-model-runner-test
Tracker = https://github.com/aws-solutions-library-samples/osml-model-runner-test/issues
classifiers =
Programming Language :: Python :: 3
Operating System :: OS Independent
Expand All @@ -35,7 +35,7 @@ zip_safe = False
package_dir=
=src
packages=find_namespace:
python_requires = >=3.8
python_requires = >=3.9
include_package_data = True

install_requires =
Expand All @@ -56,5 +56,7 @@ package_data =
= ["py.typed"]

[options.extras_require]
gdal =
gdal>=3.7.0
test =
tox
2 changes: 1 addition & 1 deletion src/data/centerpoint.sicd-capella-chip.ntf.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion src/data/centerpoint.sicd-interferometric-hh.nitf.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -14384,4 +14384,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion src/data/centerpoint.sicd-umbra-chip.ntf.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@
}
}
]
}
}
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[tox]
envlist =
# Basic configurations: Run the tests for each python version.
py{39, 310, 311}-dev
py{39, 310, 311}

# Build and test the docs with sphinx.
docs
Expand All @@ -15,9 +15,11 @@ envlist =

# Pre distribution checks for the package
twine
requires = tox-conda
skip_missing_interpreters = False

[testenv]
conda_env = {toxinidir}/environment.yml
deps =
pytest==7.2.1
pytest-cov==4.0.0
Expand Down

0 comments on commit ba1a5fb

Please sign in to comment.