Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added changes for CI/CD pipeline #170

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .github/workflows/dockerimage.yml → .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,63 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish

- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
keep_history: true
build_dir: docs/build/html/.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build and publish to PyPi
env:
TWINE_USERNAME: ${{ secrets.pypi_username }}
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

- name: Setup environment for Docker image publish
run: |
echo "GITHUB_REF=${GITHUB_REF:10}" >> $GITHUB_ENV

- name: Login to Docker Hub
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin

- name: Build the tagged Docker image
run: docker build . --file Dockerfile --tag hewlettpackardenterprise/hpe-oneview-sdk-for-python:${{ env.GITHUB_REF }}-OV6.2

- name: Push the tagged Docker image
run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-python:${{ env.GITHUB_REF }}-OV6.2

- name: Send mail notifier about status of pipeline
uses: dawidd6/action-send-mail@v2
with:
server_address: smtp-mail.outlook.com
server_port: 587
username: ${{secrets.MAIL_USERNAME}}
password: ${{secrets.MAIL_PASSWORD}}
subject: OneViewSDK Daily Deployment Results – ${{job.status}}
body: |
Hi All,
OneViewSDK daily deployment on build 6.20.00 is considered a ${{job.status}} for Synergy Composer and VM appliances.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since our release version and ov version is same can we use ${{ env.RELEASE_VERSION }} instead of giving the build versione everytime

link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

Thanks,
OneView SDK Deployment Automation
to: [email protected]
from: github-actions
priority: high
31 changes: 15 additions & 16 deletions .github/workflows/run_tests.yml → .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: python CI

on:
- pull_request
on: [push, pull_request]

jobs:
tox_test:
Expand All @@ -25,7 +24,12 @@ jobs:
python -m pip install --upgrade pip
pip install tox

- name: Run tox tests
# - name: Analysing the code with pylint
# run: |
# pip install pylint
# pylint $(git ls-files '*.py')

- name: Run unit tests using tox
run: tox

Build_and_publish:
Expand All @@ -49,22 +53,17 @@ jobs:
python -m pip install --upgrade pip
pip install tox

- name: Run tox tests
run: tox
# - name: Analysing the code with pylint
# run: |
# pip install pylint
# pylint $(git ls-files '*.py')

- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
keep_history: true
build_dir: docs/build/html/.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run unit tests using tox
run: tox

- name: coveralls
- name: Check coverage
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.COVERALLS_TOKEN }}
flag-name: 'Unit Test'
debug: true
debug: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline