diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/CD.yml similarity index 57% rename from .github/workflows/dockerimage.yml rename to .github/workflows/CD.yml index 36ca8bd78..a2ae87d0e 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/CD.yml @@ -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. + link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + + Thanks, + OneView SDK Deployment Automation + to: bala-sai-harika.chebrolu@hpe.com + from: github-actions + priority: high diff --git a/.github/workflows/run_tests.yml b/.github/workflows/CI.yml similarity index 74% rename from .github/workflows/run_tests.yml rename to .github/workflows/CI.yml index 8c144911e..402044110 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/CI.yml @@ -1,7 +1,6 @@ name: python CI -on: -- pull_request +on: [push, pull_request] jobs: tox_test: @@ -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: @@ -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 \ No newline at end of file