Skip to content

Commit

Permalink
Add code coverage tool (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
berland authored Jan 15, 2021
1 parent d7ea578 commit 9018f73
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: codecoverage
on:
pull_request:
branches: [master]
push:
branches: [master]

jobs:
coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
env:
OS: ${{ matrix.os }}
PYTHON: '3.7'

steps:
- uses: actions/checkout@master

- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.7

- name: Install fmu-tools and test dependencies
run: |
pip install pip -U
pip install .[tests]
- name: Generate coverage report
run: |
git clone --depth 1 https://github.com/equinor/xtgeo-testdata ../xtgeo-testdata
pytest tests --disable-warnings --cov=fmu --cov-report=xml
- name: Upload coverage to Codecov
run: |
bash <(curl -s https://codecov.io/bash)
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
.. image:: https://img.shields.io/lgtm/alerts/g/equinor/fmu-tools.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/equinor/fmu-tools/alerts/

.. image:: https://codecov.io/gh/equinor/fmu-tools/branch/master/graph/badge.svg
:target: https://codecov.io/gh/equinor/fmu-tools

.. image:: https://img.shields.io/lgtm/grade/python/g/equinor/fmu-tools.svg?logo=lgtm&logoWidth=18
:target: https://lgtm.com/projects/g/equinor/fmu-tools/context:python

Expand All @@ -22,4 +25,4 @@ Documentation can be found on https://equinor.github.io/fmu-tools/.

This software is released under LGPLv3.

Copyright 2018-2020 Equinor ASA.
Copyright 2018-2021 Equinor ASA.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def parse_requirements(filename):
"flake8",
"pre-commit",
"pytest",
"pytest-cov",
]

DOCS_REQUIREMENTS = [
Expand Down

0 comments on commit 9018f73

Please sign in to comment.