Skip to content

Commit

Permalink
build: updating to use trunk based development
Browse files Browse the repository at this point in the history
  • Loading branch information
drduhe committed Apr 4, 2024
1 parent d4e2d83 commit 1134c12
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 260 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: build

on:
pull_request:
branches: ["main"]

jobs:
tox:
uses: ./.github/workflows/tox.yml
secrets: inherit
docker-build:
uses: ./.github/workflows/docker-build.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 @@ -8,22 +8,20 @@ permissions:

jobs:
docs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- 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
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.

29 changes: 29 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
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.

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

on:
release:
types: [published]

jobs:
tox:
uses: ./.github/workflows/tox.yml
secrets: inherit
docker-build:
uses: ./.github/workflows/docker-build.yml
secrets: inherit
pypi:
needs: [tox, docker-build]
uses: ./.github/workflows/pypi.yml
secrets: inherit
docker-publish:
needs: [tox, docker-build]
uses: ./.github/workflows/docker-publish.yml
secrets: inherit
docs:
needs: [pypi, docker-publish]
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 1134c12

Please sign in to comment.