Skip to content

Commit

Permalink
Add workflows and linters
Browse files Browse the repository at this point in the history
  • Loading branch information
biancabnd committed Apr 5, 2023
1 parent afd18c9 commit 38d407e
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
BasedOnStyle: Google
AlwaysBreakAfterDefinitionReturnType: All
BreakBeforeBraces: Allman
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 88
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @umdlife/reviewers
37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!-- Please fill out the following pull request template for non-trivial changes to help us process your PR faster and more efficiently.-->

---

## Basic Info

| Info | Please fill out this column |
| ------ | ----------- |
| Ticket(s) this addresses | (add tickets here #1) |
| Primary OS tested on | (Ubuntu, MacOS, Windows) |
| Robotic platform tested on | (Steve's Robot, gazebo simulation of Tally, hardware turtlebot) |

---

## Description of contribution in a few bullet points

<!--
* I added this neat new feature
* Also fixed a typo in a parameter name in nav2_costmap_2d
-->

## Description of documentation updates required from your changes

<!--
* Added new parameter, so need to add that to default configs and documentation page
* I added some capabilities, need to document them
-->

---

## Future work that may be required in bullet points

<!--
* I think there might be some optimizations to be made from STL vector
* I see alot of redundancy in this package, we might want to add a function `bool XYZ()` to reduce clutter
* I tested on a differential drive robot, but there might be issues turning near corners on an omnidirectional platform
-->
20 changes: 20 additions & 0 deletions .github/workflows/delete_docker_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Delete PR Docker Image

# Controls when the workflow will run
on:
pull_request:
types:
- closed
branches:
- 'dev'
jobs:
delete-docker:
strategy:
matrix:
parent_repo: [umd_robot_essentials]
uses: umdlife/umd_workflows/.github/workflows/delete_docker.yaml@main
with:
repository: ${{ matrix.parent_repo }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/jira_ticket_from_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Create a Jira ticket in UML Jira every time a Github issue is opened
name: Create Jira Ticket from Github Issue
on:
issues:
types: opened

jobs:
create_jira_ticket:
runs-on: ubuntu-latest
name: Create Jira Ticket from Issue
steps:

# Login to Jira
- name: Login
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

# Create ticket
- name: Create
id: create
uses: atlassian/gajira-create@master
with:
project: UP # UL-Platform
issuetype: Story
summary: |
Github Issue #${{ github.event.issue.number }} in ${{ github.repository }}: ${{ github.event.issue.title }}
description: |
Issue #${{ github.event.issue.number }} in ${{ github.repository }} (${{ github.event.issue.html_url }})
${{ github.event.issue.title }}:
${{ github.event.issue.body }}
fields: '{"customfield_10028": 0}' # Initializing Story points. Custom field can vary depending on the project/platform

- name: Log created issue
run: echo "Issue ${{ steps.create.outputs.issue }} was created"
33 changes: 33 additions & 0 deletions .github/workflows/test_docker_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test Docker Build

# Controls when the workflow will run
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: write
statuses: write
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
clang_format:
uses: umdlife/umd_workflows/.github/workflows/clang_format_lint.yaml@main
secrets:
PAT: ${{ secrets.UMDLIFEDEV_TOKEN }}

rebuild_docker:
strategy:
matrix:
parent_repo: [umd_robot_essentials]
stage: [dev_stage, prod_stage]
uses: umdlife/umd_workflows/.github/workflows/rebuild_docker_dep.yaml@main
with:
repository: ${{ matrix.parent_repo }}
arch: linux/amd64
stage: ${{ matrix.stage }}
push: true
secrets:
PAT: ${{ secrets.UMDLIFEDEV_TOKEN }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
language_version: python3.8
- repo: https://gitlab.com/pycqa/flake8
rev: '3.7.9' # pick a git hash / tag to point to
hooks:
- id: flake8
- repo: https://gitlab.com/daverona/pre-commit/cpp
rev: 0.8.0 # use the most recent version
hooks:
# Hooks using native
- id: clang-format # formatter for C/C++ code based on a style guide
args: ['-style=file']
- id: cpplint # linter (or style-error checker) for Google C++ Style Guide
- id: cppcheck # static analyzer for C/C++ code

2 changes: 2 additions & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
linelength=88
filter=-build/include_order,-whitespace/braces,-whitespace/newline

0 comments on commit 38d407e

Please sign in to comment.