Skip to content

Commit

Permalink
setting up github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcmaxson committed Jan 21, 2022
1 parent b35e8d6 commit 73721ea
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 18 deletions.
67 changes: 67 additions & 0 deletions .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
2 changes: 1 addition & 1 deletion conf.py
Expand Up @@ -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 ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion methylcheck/version.py
Expand Up @@ -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'
34 changes: 18 additions & 16 deletions setup.py
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 73721ea

Please sign in to comment.