-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from philips-software/funcDefExtractorEnhanced
Func def extractor enhanced
- Loading branch information
Showing
60 changed files
with
2,431 additions
and
659 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,79 @@ | ||
# Koninklijke Philips N.V., 2019 - 2020. All rights reserved. | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python application | ||
|
||
name: Build Python application and Publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
create: | ||
branches: [ master ] | ||
env: | ||
NODE_VERSION: '10.x' # set this to the node version to use | ||
NODE_VERSION: '10.13.0' # set this to the node version to use | ||
jobs: | ||
build: | ||
name: Conduct "Static analysis, Test & Coverage, Spell check, Mutation testing " for 🐍 code | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Upgrade pip | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
- name: Install dependencies Conduct Static analysis Test Coverage Mutation | ||
run: | | ||
python3 build_scripts/dependencies_static_analysis_test_cov.py | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: my-artifact_static_analysis | ||
path: | | ||
htmlcov | ||
CC.xml | ||
jscpd-report.json | ||
mutation.txt | ||
runs-on: ubuntu-latest | ||
|
||
publish: | ||
name: Build , Smoke test , Performance test, and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
needs: build | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.7 | ||
- name: Fetch all history for all tags and branches | ||
run: git fetch --prune --unshallow | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Install dependencies | ||
python-version: 3.8 | ||
- name: Install the dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: npm install | ||
python3 build_scripts/install_dependencies.py | ||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
sudo npm install | ||
sudo npm install -g jscpd@3.2.1 | ||
- name: ctags install | ||
python3 setup.py sdist bdist_wheel | ||
- name: Install newly created wheel | ||
run: | | ||
sudo apt-get install ctags | ||
export PATH="$PATH:/usr/bin/ctags" | ||
ctags --version | ||
- name: Static Analysis | ||
python3 build_scripts/install_package.py | ||
- name: Conduct the sanity test on new wheel created | ||
run: | | ||
pylint functiondefextractor/ test/ | ||
jscpd --min-tokens 20 --reporters "json" --mode "strict" --format "python" -o . . | ||
python3 test_resource/jscpd_parser.py --j 10 #Allowed duplication is 10% with 20 token size | ||
python3 build_scripts/sanity_test.py | ||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.test_pypi_password }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{ secrets.pypi_password }} | ||
|
||
- name: Cyclomatic complexity | ||
run: | | ||
python3 -m lizard functiondefextractor -X> CC.xml | ||
python3 test_resource/cyclo_gate.py --c 7 #Allowed cyclomatic complexity is less than 7 | ||
- name: Dead Code | ||
run: | | ||
python3 -m vulture functiondefextractor | ||
- name: Tests & Coverage | ||
run: | | ||
pytest test --cov-config=.coveragerc --cov=functiondefextractor | ||
coverage report --fail-under=90 #Coverage should be above 90% | ||
codecov | ||
- name: Mutation Tests | ||
run: | | ||
mutmut run > mutmut.log || true # Checking mutation on main file as the travis max execution time is overshooting | ||
mutmut junitxml --suspicious-policy=ignore --untested-policy=ignore > mutmut.xml | ||
python3 test_resource/mutmut_parse.py --m 20 #Mutation (failure+disables+error) allowed 20% of total mutants |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build/ | ||
dist/ | ||
functiondefextractor.egg-info/ | ||
__pycache__ | ||
functiondefextractor/extractor.log | ||
functiondefextractor\extractor.log | ||
.eggs/"version.txt" | ||
.eggs/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
matrix: | ||
|
||
- name: py | ||
sources: | ||
- "functiondefextractor/*.py" | ||
- "test/*.py" | ||
aspell: | ||
lang: en | ||
dictionary: | ||
wordlists: | ||
- spell_check/spell_ignore_py.txt | ||
pipeline: | ||
- pyspelling.filters.python: | ||
comments: false | ||
|
||
- name: markdown | ||
pipeline: | ||
- pyspelling.filters.text | ||
sources: | ||
- '**/*.md' | ||
aspell: | ||
lang: en | ||
dictionary: | ||
wordlists: | ||
- spell_check/spell_ignore_md.txt | ||
default_encoding: utf-8 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.