Skip to content
Snippets Groups Projects
Commit 55876b86 authored by Michele Nottoli's avatar Michele Nottoli
Browse files

Added CI

parent 71b1c3aa
Branches
Tags
1 merge request!1Added CI
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
![CI_Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/grext/badges/main/pipeline.svg)
![Pylint Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/grext/-/jobs/artifacts/main/raw/public/pylint_badge.svg?job=lint)
![Coverage Badge](https://gitlab.mathematik.uni-stuttgart.de/nottolme/grext/-/jobs/artifacts/main/raw/public/coverage.svg?job=coverage.svg)
# grext: Grassmann Extrapolation Library
......@@ -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=[
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment