Skip to content

Commit

Permalink
Update codecov setup
Browse files Browse the repository at this point in the history
  • Loading branch information
stefmolin committed Jun 1, 2024
1 parent e8a6507 commit e8e4573
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is the configuration for codecov.yml -- remember to validate it.
#
# cat .github/codecov.yml | curl --data-binary @- https://codecov.io/validate

codecov:
notify:
wait_for_ci: false
require_ci_to_pass: false

coverage:
status:
patch:
default:
target: 90%
project:
default: false
exif_stripper:
target: 90%
paths:
- "!tests/.*"
tests:
target: 100%
paths:
- "tests/.*"

comment:
layout: "reach, diff, files"
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@ jobs:
run: pytest

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v4.2.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/codecov-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow checks that the codecov.yml file is valid, if it is included in the PR.
#
# Author: Stefanie Molin

name: Validate codecov config

on:
pull_request:
paths:
- '.github/codecov.yml'
schedule:
- cron: '21 21 21 * *'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
# check that the codecov.yml configuration is valid
codecov:
runs-on: ubuntu-latest
name: Validate codecov.yml
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate with codecov API
run: |
response=$(cat .github/codecov.yml | curl --data-binary @- https://codecov.io/validate)
echo $response
if [[ $response = Error* ]]; then
exit 1
fi

0 comments on commit e8e4573

Please sign in to comment.