Skip to content

Commit

Permalink
v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels committed Jul 18, 2021
2 parents c0f3c87 + d9032c0 commit 232dfa8
Show file tree
Hide file tree
Showing 13 changed files with 329 additions and 127 deletions.
245 changes: 245 additions & 0 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
name: Unit Testing, Coverage Collection, Package, Release, Documentation and Publish

on: [ push ]

defaults:
run:
shell: bash

jobs:
UnitTesting:
name: ${{ matrix.icon }} Unit Tests using Python ${{ matrix.python }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- {python: 3.6, icon: 🔴}
- {python: 3.7, icon: 🟠}
- {python: 3.8, icon: 🟡}
- {python: 3.9, icon: 🟢}

env:
PYTHON: ${{ matrix.python }}
outputs:
python: ${{ env.PYTHON }}

steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v2

- name: 🐍 Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: 🔧 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
- name: ☑ Run unit tests
run: |
python -m pytest -rA tests/unit
Coverage:
name: 📈 Collect Coverage Data using Python 3.9
runs-on: ubuntu-latest

env:
PYTHON: 3.9
outputs:
python: ${{ env.PYTHON }}

steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v2

- name: 🐍 Setup Python ${{ env.PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON }}

- name: 🗂 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
- name: Collect coverage
continue-on-error: true
run: |
python -m pytest -rA --cov=.. --cov-config=tests/.coveragerc tests/unit
- name: Convert to cobertura format
run: |
coverage xml
- name: 📊 Publish coverage at CodeCov
continue-on-error: true
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
env_vars: PYTHON

- name: 📉 Publish coverage at Codacy
continue-on-error: true
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage.xml

Release:
name: 📝 Create 'Release Page' on GitHub
runs-on: ubuntu-latest

if: startsWith(github.ref, 'refs/tags')
needs:
- UnitTesting
- Coverage

env:
PYTHON: ${{ needs.Coverage.outputs.python }}
outputs:
python: ${{ env.PYTHON }}
tag: ${{ steps.getVariables.outputs.gitTag }}
version: ${{ steps.getVariables.outputs.version }}
datetime: ${{ steps.getVariables.outputs.datetime }}
upload_url: ${{ steps.createReleasePage.outputs.upload_url }}

steps:
- name: 🔁 Extract Git tag from GITHUB_REF
id: getVariables
run: |
GIT_TAG=${GITHUB_REF#refs/*/}
RELEASE_VERSION=${GIT_TAG#v}
RELEASE_DATETIME="$(date --utc '+%d.%m.%Y - %H:%M:%S')"
# write to step outputs
echo ::set-output name=gitTag::${GIT_TAG}
echo ::set-output name=version::${RELEASE_VERSION}
echo ::set-output name=datetime::${RELEASE_DATETIME}
- name: 📑 Create Release Page
id: createReleasePage
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.getVariables.outputs.gitTag }}
# release_name: ${{ steps.getVariables.outputs.gitTag }}
body: |
**Automated Release created on: ${{ steps.getVariables.outputs.datetime }}**
# New Features
* tbd
# Changes
* tbd
# Bug Fixes
* tbd
draft: false
prerelease: false

Package:
name: 📦 Package in Wheel Format
runs-on: ubuntu-latest

if: startsWith(github.ref, 'refs/tags')
needs:
- Coverage

env:
PYTHON: ${{ needs.Coverage.outputs.python }}
ARTIFACT: pyGenericPath-wheel
outputs:
python: ${{ env.PYTHON }}
artifact: ${{ env.ARTIFACT }}

steps:
- name: 📥 Checkout repository
uses: actions/checkout@v2

- name: 🐍 Setup Python ${{ env.PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON }}

- name: 🔧 Install dependencies for packaging and release
run: |
python -m pip install --upgrade pip
pip install wheel
- name: 🔨 Build Python package (source distribution)
run: |
python setup.py sdist
- name: 🔨 Build Python package (binary distribution - wheel)
run: |
python setup.py bdist_wheel
- name: 📤 Upload 'pyGenericPath' artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.ARTIFACT }}
path: dist/
if-no-files-found: error
retention-days: 1

PublishOnPyPI:
name: 🚀 Publish to PyPI
runs-on: ubuntu-latest

if: startsWith(github.ref, 'refs/tags')
needs:
- Package

env:
PYTHON: ${{ needs.Package.outputs.python }}
ARTIFACT: ${{ needs.Package.outputs.artifact }}
outputs:
python: ${{ env.PYTHON }}
artifact: ${{ env.ARTIFACT }}

steps:
- name: 📥 Download artifacts '${{ env.ARTIFACT }}' from 'Package' job
uses: actions/download-artifact@v2
with:
name: ${{ env.ARTIFACT }}
path: dist/

- name: 🐍 Setup Python ${{ env.PYTHON }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON }}

- name: ⚙ Install dependencies for packaging and release
run: |
python -m pip install --upgrade pip
pip install wheel twine
- name: ⤴ Release Python package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
ArtifactCleanUp:
name: 🗑️ Artifact Cleanup
runs-on: ubuntu-latest

needs:
- Package
- PublishOnPyPI

env:
ARTIFACT: ${{ needs.Package.outputs.artifact }}

steps:
- name: 🗑️ Delete all Artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: |
${{ env.ARTIFACT }}
90 changes: 0 additions & 90 deletions .github/workflows/Workflow.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/pyGenericPath.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# -- Project information -----------------------------------------------------

project = 'pyGenericPath'
copyright = '2017-2020, Patrick Lehmann'
copyright = '2017-2021, Patrick Lehmann'
author = 'Patrick Lehmann'

# The full version, including alpha/beta/rc tags
release = 'v0.1'
release = 'v0.2'


# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit 232dfa8

Please sign in to comment.