Skip to content

Commit 51cabd5

Browse files
committed
Add Codecov integration and update GitHub Actions workflow
1 parent 3e75ba3 commit 51cabd5

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

.github/workflows/build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
branches: [ main ]
1010
paths-ignore:
1111
- '**/_version.py'
12+
workflow_dispatch:
13+
1214

1315
jobs:
1416
test:
@@ -35,3 +37,19 @@ jobs:
3537
run: |
3638
make release
3739
shell: bash
40+
- name: Upload coverage reports
41+
if: |
42+
${{
43+
success()
44+
&& (
45+
(github.event_name == 'pull_request' && github.base_ref == 'main')
46+
|| (github.event_name == 'push' && github.ref_name == 'main')
47+
|| github.event_name == 'workflow_dispatch'
48+
)
49+
&& matrix.python-version == '3.11'
50+
}}
51+
uses: codecov/codecov-action@v5
52+
with:
53+
# https://github.com/codecov/codecov-action#arguments
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
env_vars: PYTHON_VERSION

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# AIBS Informatics AWS Utils
22

33
[![Build Status](https://github.com/AllenInstitute/aibs-informatics-aws-utils/actions/workflows/build.yml/badge.svg)](https://github.com/AllenInstitute/aibs-informatics-aws-utils/actions/workflows/build.yml)
4+
[![codecov](https://codecov.io/gh/AllenInstitute/aibs-informatics-aws-utils/graph/badge.svg?token=I3A5UC9CMX)](https://codecov.io/gh/AllenInstitute/aibs-informatics-aws-utils)
45

56
---
67

codecov.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
codecov:
2+
bot: aibsgithub
3+
4+
coverage:
5+
range: 0..100
6+
status:
7+
project:
8+
default:
9+
target: auto # auto compares coverage to the previous base commit
10+
informational: true
11+
patch:
12+
default:
13+
informational: true
14+
15+
comment:
16+
layout: "reach, diff, flags, files"
17+
behavior: default
18+
require_changes: false # if true: only post the comment if coverage changes
19+
require_head: yes # [yes :: must have a head report to post]
20+
require_base: no # default yes
21+
22+
github_checks:
23+
# set to true in future perhaps?
24+
annotations: false
25+
26+
flag_management:
27+
default_rules: # the rules that will be followed for any flag added, generally
28+
carryforward: true
29+
statuses:
30+
- type: project
31+
target: auto
32+
threshold: 1%
33+
- type: patch
34+
target: 90%

0 commit comments

Comments
 (0)