Skip to content

Commit

Permalink
Merge pull request #20 from tadeugr/pipeline-deploy-after-test
Browse files Browse the repository at this point in the history
Github Actions pipeline deploy depends on tests
  • Loading branch information
tadeugr committed Aug 18, 2022
2 parents a52f8a0 + 201aa69 commit f18f913
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 97 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: pipeline

on: [push]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --disable-pytest-warnings --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests

release:
name: Create Release
needs: test
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: ${{ github.workspace }}/CHANGELOG.txt
draft: false
prerelease: false

deploy:
name: Deploy to PyPI
needs: release
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish
if: "!endsWith(github.ref, '-rc')"
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
48 changes: 0 additions & 48 deletions .github/workflows/publish.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/test.yaml

This file was deleted.

8 changes: 2 additions & 6 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
- Remove --with-azurecli option
- Fix Github Actions pipeline to run deploy after tests pass.

- Drop Python 3.6 support

- Automatically add --apt=python3-pip when --pip3=<blah> is used

- Add --with-terraform
- No new features.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Quickly build custom Docker images for local development without having to write Dockerfiles.

[![PyPI](https://img.shields.io/badge/pypi-latest-blue)](https://pypi.org/project/dugaire/)
[![Python](https://img.shields.io/badge/python-3.7%20%7C%203.8-blue)](https://pypi.org/project/dugaire/)
[![Python](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)](https://pypi.org/project/dugaire/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![test](https://github.com/tadeugr/dugaire/workflows/test/badge.svg?branch=master)](https://github.com/tadeugr/dugaire/actions?query=workflow%3Atest)
[![publish](https://github.com/tadeugr/dugaire/workflows/publish/badge.svg)](https://github.com/tadeugr/dugaire/actions?query=workflow%3Apublish)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ The report is available

.. |PyPI| image:: https://img.shields.io/badge/pypi-latest-blue
:target: https://pypi.org/project/dugaire/
.. |Python| image:: https://img.shields.io/badge/python-3.7%20%7C%203.8-blue
.. |Python| image:: https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue
:target: https://pypi.org/project/dugaire/
.. |Code style: black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
Expand Down
2 changes: 1 addition & 1 deletion docs/template/README.md.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Quickly build custom Docker images for local development without having to write Dockerfiles.

[![PyPI](https://img.shields.io/badge/pypi-latest-blue)](https://pypi.org/project/dugaire/)
[![Python](https://img.shields.io/badge/python-3.7%20%7C%203.8-blue)](https://pypi.org/project/dugaire/)
[![Python](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue)](https://pypi.org/project/dugaire/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![test](https://github.com/tadeugr/dugaire/workflows/test/badge.svg?branch=master)](https://github.com/tadeugr/dugaire/actions?query=workflow%3Atest)
[![publish](https://github.com/tadeugr/dugaire/workflows/publish/badge.svg)](https://github.com/tadeugr/dugaire/actions?query=workflow%3Apublish)
Expand Down
2 changes: 1 addition & 1 deletion dugaire/pkg/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def get_version():
return "0.0.13"
return "0.0.14"


def get_prog_name():
Expand Down

0 comments on commit f18f913

Please sign in to comment.