Skip to content

Commit

Permalink
build: migrating to trunk based dev patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
drduhe committed Apr 4, 2024
1 parent ecfb43e commit a698410
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 276 deletions.
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**Issue #, if available:** n/a

### Notes


### Checklist

Before you submit a pull request, please make sure you have the following:
- [ ] Code changes are compact and well-structured to facilitate easy review
- [ ] Changes are documented in the README.md and other relevant documentation pages
- [ ] PR title and description accurately reflect the changes and are detailed enough for historical tracking
- [ ] PR contains tests that cover all new code and the code has been manual tested
- [ ] All new dependencies are declared (if any), and no unnecessary libraries are added
- [ ] Performance impacts (if any) of the changes are evaluated and documented
- [ ] Security implications of the changes (if any) are reviewed and addressed
- [ ] I have read the [Contributing Guidelines](../CONTRIBUTING.md) and agree to follow the [Code of Conduct](../CODE_OF_CONDUCT.md)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: build

on:
pull_request:
branches: ["main"]

jobs:
tox:
uses: ./.github/workflows/tox.yml
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate and Publish Documentation for OSML Model Runner Test
name: docs

on:
workflow_call:
Expand All @@ -14,18 +14,14 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
- name: Build Docs
run: |
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: |
tox -e docs
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/[email protected]
- uses: peaceiris/[email protected]
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Notify Guidance Overhead Imagery Repo
name: notify

on:
workflow_call:
push:
branches: ["main"]

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Short Sha
uses: benjlevesque/[email protected]
- name: Invoke Guidance OSML Submodule Workflow
uses: benc-uk/[email protected]
- uses: benjlevesque/[email protected]
- uses: benc-uk/[email protected]
with:
repo: aws-solutions-library-samples/guidance-for-overhead-imagery-inference-on-aws
workflow: osml_update_submodules.yml
ref: dev
token: ${{ secrets.GUIDANCE_OSML_SUBMODULES_ACTION_10_24 }}
inputs: '{ "DISPATCH_REPO_NAME" : "${{ github.event.repository.name }}", "DISPATCH_REPO_SHA": "${{ env.SHA }}" }'
10 changes: 0 additions & 10 deletions .github/workflows/osml-model-runner-test-build.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/osml-model-runner-test-publish.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

name: pypi

on:
workflow_call:

permissions:
contents: read
id-token: write

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build Package
run: |
python -m pip install --upgrade pip
pip install build
python -m build
- uses: pypa/[email protected]
33 changes: 0 additions & 33 deletions .github/workflows/python-publish.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: release

on:
release:
types: [published]

jobs:
tox:
uses: ./.github/workflows/tox.yml
secrets: inherit
pypi:
needs: [tox]
uses: ./.github/workflows/pypi.yml
secrets: inherit
docs:
needs: [pypi]
uses: ./.github/workflows/docs.yml
secrets: inherit
15 changes: 5 additions & 10 deletions .github/workflows/python-tox.yml → .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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
name: tox

on:
workflow_call:
Expand All @@ -10,21 +10,16 @@ permissions:
contents: read

jobs:
build:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
lfs: 'true'
ssh-key: ${{ secrets.git_ssh_key }}
- name: Set up Python 3.10
uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
- name: Run Tox
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
Loading

0 comments on commit a698410

Please sign in to comment.