Skip to content

Commit

Permalink
Adds automated codecov support to Hatchet (LLNL#129)
Browse files Browse the repository at this point in the history
* Adds automated codecov support to Hatchet

* Bumps Python version for black and flake checks to 3.9 to ensure tool compatibility
  • Loading branch information
ilumsden authored May 24, 2024
1 parent 6a6d702 commit 7175a27
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 37 deletions.
13 changes: 0 additions & 13 deletions .codecov.yml

This file was deleted.

44 changes: 20 additions & 24 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ jobs:
# https://github.com/actions/setup-python/issues/162
os: [ubuntu-20.04]
# TODO: add pypy2, pypy3
python-version: [3.6, 3.7, 3.8]
exclude:
- os: macos-latest
python-version: [3.6]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
Expand All @@ -41,31 +38,27 @@ jobs:
python -m pip list
- name: Update Black
if: ${{ matrix.python-version == 3.7 }}
if: ${{ matrix.python-version == 3.9 }}
run: |
pip install flake8-pytest-importorskip
pip install --upgrade click==8.0.4
pip install black==21.12b0
pip install flake8==4.0.1
- name: Lint and Format Check with Flake8 and Black
if: ${{ matrix.python-version == 3.7 }}
if: ${{ matrix.python-version == 3.9 }}
run: |
black --diff --check .
flake8
- name: Check License Headers
run: |
python license.py verify
- name: Update Coverage
if: ${{ matrix.python-version == 3.8 }}
run: |
pip install coverage==6.2
- name: Basic Test with pytest
- name: Install coverage tools
run: |
PYTHONPATH=. coverage run $(which pytest)
pip install codecov
pip install pytest-cov
- name: Clone Caliper
uses: actions/checkout@v2
Expand Down Expand Up @@ -98,13 +91,16 @@ jobs:

- name: Test Caliper and Timemory Support with pytest
run: |
PYTHONPATH=. coverage run $(which pytest)
# - name: "Upload coverage to Codecov"
# uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # @v2.1.0
# if: ${{ matrix.python-version >= 3.7 }}
# with:
# fail_ci_if_error: true
# verbose: true
# env_vars: OS,PYTHON
# directory: ./.coverage
PYTHONPATH=. $(which pytest) --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.HATCHET_CODECOV_TOKEN }}
with:
directory: ./coverage/reports
env_vars: OS,PYTHON
files: /home/runner/work/hatchet/hatchet/coverage.xml
flags: unittests
verbose: true
fail_ci_if_error: true
15 changes: 15 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coverage:
round: down
range: 65...100

ignore:
- hatchet/tests/*
- docs/examples/*

comment:
layout: "header, diff, changes, tree"
behavior: new
require_changes: false
require_base: false
require_head: true
after_n_builds: 5

0 comments on commit 7175a27

Please sign in to comment.