Skip to content

Commit

Permalink
Merge pull request #30 from AllenInstitute/feature/add-codecov-config
Browse files Browse the repository at this point in the history
Add Codecov integration and update GitHub Actions workflow
  • Loading branch information
rpmcginty authored Dec 23, 2024
2 parents 695398d + 3c1baa5 commit 700b9b1
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
branches: [ main ]
paths-ignore:
- '**/_version.py'
workflow_dispatch:


jobs:
test:
Expand All @@ -35,3 +37,19 @@ jobs:
run: |
make release
shell: bash
- name: Upload coverage reports
if: |
${{
success()
&& (
(github.event_name == 'pull_request' && github.base_ref == 'main')
|| (github.event_name == 'push' && github.ref_name == 'main')
|| github.event_name == 'workflow_dispatch'
)
&& matrix.python-version == '3.11'
}}
uses: codecov/codecov-action@v5
with:
# https://github.com/codecov/codecov-action#arguments
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON_VERSION
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# AIBS Informatics CDK Library

[![Build Status](https://github.com/AllenInstitute/aibs-informatics-cdk-lib/actions/workflows/build.yml/badge.svg)](https://github.com/AllenInstitute/aibs-informatics-cdk-lib/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/AllenInstitute/aibs-informatics-cdk-lib/graph/badge.svg?token=5XCVULUK3E)](https://codecov.io/gh/AllenInstitute/aibs-informatics-cdk-lib)

---

Expand Down
34 changes: 34 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
codecov:
bot: aibsgithub

coverage:
range: 0..100
status:
project:
default:
target: auto # auto compares coverage to the previous base commit
informational: true
patch:
default:
informational: true

comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_head: yes # [yes :: must have a head report to post]
require_base: no # default yes

github_checks:
# set to true in future perhaps?
annotations: false

flag_management:
default_rules: # the rules that will be followed for any flag added, generally
carryforward: true
statuses:
- type: project
target: auto
threshold: 1%
- type: patch
target: 90%
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies = [
dev = [
"aibs-informatics-test-resources[all]~=0.0.4",
"boto3-stubs[s3,batch]",
"mypy~=1.13.0",
]

release = [
Expand Down

0 comments on commit 700b9b1

Please sign in to comment.