Skip to content

Commit

Permalink
added template
Browse files Browse the repository at this point in the history
  • Loading branch information
JMante1 committed Jun 11, 2021
1 parent f1827cd commit 42074f5
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 3 deletions.
1 change: 1 addition & 0 deletions workflow-templates/docker-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions workflow-templates/docker-push.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Docker Push",
"description": "To build and push a new docker image to dockerhub",
"iconName": "docker-logo",
"filePatterns": [
"^Dockerfile"
]
}
24 changes: 24 additions & 0 deletions workflow-templates/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and push docker images

on:
push:
branches:
- [ $default-branch ]

jobs:
build-and-push:
name: Build image and push to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout source code
- name: Build the Docker image
run: |
docker build . --tag synbiohub/{image_name}:snapshot
- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push the image to Docker Hub
run: |
docker push synbiohub/{image_name}:snapshot
9 changes: 6 additions & 3 deletions workflow-templates/python-linting.properties.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "Python Linting",
"description": "Flake8 linting on pull request",
"iconName": "python-snake",
"name": "Python Testing",
"description": "Run pytest tests found in the package/tests folder",
"iconName": "python-logo",
"categories": [
"Python"
],
"filePatterns": [
"requirements.txt"
]
}
1 change: 1 addition & 0 deletions workflow-templates/python-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions workflow-templates/python-testing.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Python Linting",
"description": "Flake8 linting on pull request",
"iconName": "python-logo",
"categories": [
"Python"
]
}
27 changes: 27 additions & 0 deletions workflow-templates/python-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Shell Scripts Unit Testing

on:
pull_request:
branches: [ $default-branch ]

jobs:
testing_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9.5
uses: actions/setup-python@v1
with:
python-version: 3.9.5
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install Pytest dependencies
run: |
python -m pip install pytest
python -m pip install -e {package_name}
- name: Test with pytest
run: |
cd ./{package_name} #this may be needed if the package/package/test structure is used
python -m pytest -vv -s

0 comments on commit 42074f5

Please sign in to comment.