Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 95%
project:
default: false
docstringify:
target: 95%
paths:
- "!tests/.*"
tests:
target: 100%
paths:
- "tests/.*"

comment:
layout: "reach, diff, files"
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow builds docstringify on Mac, Linux, and Windows for
# This workflow builds Docstringify on Mac, Linux, and Windows for
# multiple versions of Python to confirm it can be properly installed.
#
# Based on https://github.com/stefmolin/data-morph/blob/main/.github/workflows/ci.yml
Expand Down Expand Up @@ -66,4 +66,12 @@ jobs:
run: python -m pip install --group dev

- name: Validate pre-commit hook
run: pre-commit try-repo . docstringify
run: pre-commit try-repo . docstringify --all-files

- name: Run tests
run: pytest

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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
Loading