diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..c4985f52fd2254705021aaf6c542f0ba08ec6a8b --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,56 @@ +stages: + - test + - lint + - coverage + +variables: + PYLINT_CMD: > + (pylint grext --exit-zero > pylint.out) || true + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" + +default: + image: python:latest + cache: + paths: + - .cache/pip + before_script: + - python -V + - pip install virtualenv + - virtualenv venv + - source venv/bin/activate + - pip install . + - pip install pylint anybadge coverage + tags: + - Maths + +test: + stage: test + script: + - coverage run -m pytest + artifacts: + paths: + - .coverage + +lint: + stage: lint + script: + - mkdir -p ./public + - pylint grext --exit-zero | tee pylint.out + - score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.out) + - echo "Pylint score was $score" + - anybadge --value=$score --file=public/pylint_badge.svg pylint + - echo $score | awk '{if( $1 > 8.0 ) exit 0; exit 1;}' + artifacts: + paths: + - public/pylint_badge.svg + +coverage: + stage: coverage + script: + - mkdir -p ./public + - coverage report | tee report.out + - covperc=`cat report.out | grep 'TOTAL' | sed -e 's/%//g' | awk '{print $4}'` + - anybadge --value=$covperc --file=public/coverage.svg coverage + artifacts: + paths: + - public/coverage.svg diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bd9bab5f4af1629d14ee9b00674306ed3a3432cc --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ + + + + +# grext: Grassmann Extrapolation Library + + diff --git a/setup.py b/setup.py index 9b63992db053f35d52878a611232c29e100bd738..bb17fa0791f54bb83f7ba49d488a39b897035617 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="grext", version="0.2.0", packages=find_packages(), - install_requires=["numpy", "scipy"], + install_requires=["numpy", "scipy", "pytest"], author="Michele Nottoli", description="Tools for generating new guesses for SCF calculations.", classifiers=[