diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b6373e5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,67 @@ +name: Run PyTest +on: + push: + branches: + - master + - 'feature/**' + pull_request: + branches: + - master + +jobs: + test: + name: Test on ubuntu Python ${{ matrix.python-version }} + runs-on: ubuntu-latest #${{ matrix.os }} + strategy: + max-parallel: 1 + matrix: + #os: [ubuntu-latest, windows-latest] # macOS-latest wouldn't run, so skipping. windows takes 50% longer than ubuntu + python-version: [3.8] # [3.6, 3.7, 3.8] + steps: + - name: Dump GitHub context + id: github_context_step + run: echo '${{ toJSON(github) }}' + #- name: Dump runner context + # run: echo '${{ toJSON(runner) }}' + #- name: Dump strategy context + # run: echo '${{ toJSON(strategy) }}' + - name: Checkout repo + uses: actions/checkout@v2 + - name: Install Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install pipenv pytest_cov + # pipenv install pytest_cov + pipenv install --dev --skip-lock + pipenv install -e . --skip-lock + # pipenv uses requirements.txt + + - name: Testing and coverage report + run: | + pipenv run coverage run setup.py test + pipenv run coverage xml + + - name: Publish to codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + #files: ./coverage.xml #./coverage1.xml,./coverage2.xml # optional + directory: ./ + flags: unittests # optional + name: codecov-umbrella # optional + fail_ci_if_error: true # optional (default = false) + verbose: false # optional (default = false) + + - name: Publish to GitHub # cobertura-report format publishes coverage.xml + uses: 5monkeys/cobertura-action@v12 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + minimum_coverage: 40 + fail_below_threshold: 40 + +# GHA workflow: diffs are limited to 300 files. If there are files changed that aren't matched in the first 300 files returned by the +# filter, the workflow will not run. You may need to create more specific filters so that the workflow will run automatically. +# SETUP: use https://github.com/FoxoTech/methylcheck/settings/secrets/actions to setup the CODECOV_TOKEN diff --git a/conf.py b/conf.py index d9a4783..f5250b2 100644 --- a/conf.py +++ b/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = '0.8' # The full version, including alpha/beta/rc tags -release = '0.8.3' +release = '0.8.4' # -- General configuration --------------------------------------------------- diff --git a/methylcheck/version.py b/methylcheck/version.py index 7cfbb2e..26fcf50 100644 --- a/methylcheck/version.py +++ b/methylcheck/version.py @@ -2,4 +2,4 @@ # 1) we don't load dependencies by storing it in __init__.py # 2) we can import it in setup.py for the same reason # 3) we can import it into your module module -__version__ = '0.8.3' +__version__ = '0.8.4' diff --git a/setup.py b/setup.py index 772a098..3b942b6 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,22 @@ from setuptools import setup, find_packages exec(open('methylcheck/version.py').read()) +test_requirements = [ + 'methylprep', # this is not REQUIRED but some functions in unit testing do require it, so in extras. + 'pytest', + 'pytest-pep8', + 'pytest-cov', + 'flake8', + 'coverage', + 'xlrd', + 'coveralls', # replaces python-coveralls. note that installing both in same environment will break it. + 'sphinxcontrib-apidoc', + 'm2r', + 'nbsphinx', + 'sphinx', + 'ipykernel', +] + # note: ANY param must fit on a single line or twine breaks. setup( name='methylcheck', @@ -48,24 +64,10 @@ 'openpyxl', # pandas xlsx support changed to use this ], extras_require={ - 'dev': [ - 'methylprep', # this is not REQUIRED but some functions in unit testing do require it, so in extras. - 'pytest', - 'pytest-pep8', - 'pytest-cov', - 'flake8', - 'coverage', - 'xlrd', - 'coveralls', # replaces python-coveralls. note that installing both in same environment will break it. - 'sphinxcontrib-apidoc', - 'm2r', - 'nbsphinx', - 'sphinx', - 'ipykernel', - ] + 'dev': test_requirements }, setup_requires=['pytest-runner'], - tests_require=['pytest'], + tests_require= test_requirements, entry_points={ 'console_scripts': [ 'methylcheck-cli = methylcheck.cli:cli_parser',