Skip to content

Commit

Permalink
Merge pull request #13 from VHDL/dev
Browse files Browse the repository at this point in the history
v0.9.0
  • Loading branch information
Paebbels authored Jun 13, 2021
2 parents a54aefa + b241320 commit 011ada3
Show file tree
Hide file tree
Showing 24 changed files with 3,141 additions and 825 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
target-branch: dev
commit-message:
prefix: "[Dependency Update]"
labels:
- Dependencies
assignees:
- Paebbels
reviewers:
- Paebbels
schedule:
interval: daily
27 changes: 0 additions & 27 deletions .github/workflows/Documentation.yml

This file was deleted.

263 changes: 263 additions & 0 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
name: Unit Testing, Coverage Collection, Package, Release, Documentation and Publish

on: [ push ]

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

strategy:
fail-fast: false
matrix:
python: [ 3.6, 3.7, 3.8, 3.9 ]

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: 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: pyVHDLModel-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 'pyVHDLModel' 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/*
BuildTheDocs:
name: Run BuildTheDocs and publish to GH-Pages
runs-on: ubuntu-latest
steps:

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

- name: Build documentation in 'pyVHDLModel/doc'
run: |
docker build -t vhdl/doc - <<-EOF
FROM btdi/sphinx:featured
RUN apk add -U --no-cache graphviz
EOF
- name: Unknown
uses: buildthedocs/btd@v0
with:
token: ${{ github.token }}

- name: Upload artifacts to GitHub Pages
uses: actions/upload-artifact@master
with:
name: doc
path: doc/_build/html

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 }}
43 changes: 0 additions & 43 deletions .github/workflows/Release.yml

This file was deleted.

Loading

0 comments on commit 011ada3

Please sign in to comment.