Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
Add codeowner

Add badges to README
  • Loading branch information
abdulhuq811 committed Aug 29, 2024
1 parent c026e38 commit 8f364f4
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Nike-Inc/lab222
30 changes: 30 additions & 0 deletions .github/workflows/check-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Check Version

# Controls when the action will run.
on:
# Triggers the workflow on any PRs to master
pull_request:
branches:
- main

jobs:
check-version:
strategy:
fail-fast: true
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Check Project version
run: |
git fetch origin master
NEW_VERSION=`git diff origin/master pyproject.toml | grep '^[+]version =' | awk '{gsub(/"/, "", $3); print $3}'`
OLD_VERSION=`git diff origin/master pyproject.toml | grep '^[-]version =' | awk '{gsub(/"/, "", $3); print $3}'`
if [[ $NEW_VERSION == $OLD_VERSION ]]; then
echo "Version in pyproject.toml is not updated"
exit 1
fi
37 changes: 37 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Release Docker Image

# Run when python test runs successfully on master branch
on:
workflow_run:
workflows: ["Python Test"]
branches: ["main"]
types:
- completed

jobs:
docker-build:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get Package Version
run: echo "VERSION=`cat pyproject.toml | grep '^version =' | awk '{gsub(/"/, "", $3); print $3; exit}'`" >> $GITHUB_ENV
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64,linux/arm64
tags: nikelab222/pterradactyl:latest,nikelab222/pterradactyl:${{ env.VERSION }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
38 changes: 38 additions & 0 deletions .github/workflows/python-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Release Python Package

# Run when python test runs successfully on master branch
on:
workflow_run:
workflows: ["Python Test"]
branches: ["main"]
types:
- completed

jobs:
python-build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
poetry-version: [1.4.1]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Build sdist and wheel
run: poetry build
- name: Publish to public pypi
run: |
poetry config pypi-token.pypi ${PYPI_TOKEN}
poetry publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Python Test

on:
# Triggers the workflow on push to master and any PRs to master
push:
branches:
- main
pull_request:
branches:
- main

jobs:
python-test:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
poetry-version: [1.4.1]
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install package
run: |
poetry config virtualenvs.create false && poetry install
env:
PIP_DEFAULT_TIMEOUT: "60"
- name: Run Test and generate coverate report
run: poetry run pytest --cov=./ --cov-report=xml
- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v1
with:
file: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# SageRender
![coverage](https://img.shields.io/badge/coverage-87%25-brightgreen) ![tests](https://img.shields.io/badge/tests-passed-green)
---
[![codecov](https://codecov.io/gh/Nike-Inc/sagerender/branch/main/graph/badge.svg?token=0TvSUJHvH2)](https://codecov.io/gh/Nike-Inc/sagerender)
[![Test](https://github.com/Nike-Inc/sagerender/actions/workflows/python-test.yaml/badge.svg)](https://github.com/Nike-Inc/sagerender/actions/workflows/python-test.yaml)
[![PyPi Release](https://github.com/Nike-Inc/sagerender/actions/workflows/python-build.yaml/badge.svg)](https://github.com/Nike-Inc/sagerender/actions/workflows/python-build.yaml)
[![Docker Build](https://github.com/Nike-Inc/sagerender/actions/workflows/docker-build.yaml/badge.svg)](https://github.com/Nike-Inc/sagerender/actions/workflows/docker-build.yaml)
![License](https://img.shields.io/pypi/l/knockoff)
![Python Versions](https://img.shields.io/pypi/pyversions/knockoff)
![Docker Image Size](https://img.shields.io/docker/image-size/nikelab222/sagerender/latest)
![Python Wheel](https://img.shields.io/pypi/wheel/knockoff)

![](extras/sagerender-pipeline-design.png)

A library for configuring SageMaker pipelines using hierarchical configuration pattern. The purpose of this library is to isolate depdency on AWS SageMaker SDK and allow teams to create pipelines using configurations. The hierarchical configuration gives teams flexibility to use a lookups in configuration files to traverse through the hierarchy of configurations.

## Table of Contents
Expand Down

0 comments on commit 8f364f4

Please sign in to comment.