Skip to content

Commit

Permalink
FIX: set CODECOV_TOKEN (#487)
Browse files Browse the repository at this point in the history
* DX: include workflows in VS Code search
* DX: set target coverage to 33%
* MAINT: clean up codecov configuration
  • Loading branch information
redeboer authored Jan 10, 2025
1 parent 7ca4f88 commit ae3078c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
coverage-target: compwa_policy
macos-python-version: "3.9"
specific-pip-packages: ${{ inputs.specific-pip-packages }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
style:
if: inputs.specific-pip-packages == ''
secrets:
Expand Down
8 changes: 0 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
"coverage-gutters.showLineCoverage": true,
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"files.watcherExclude": {
"**/*_cache/**": true,
"**/.eggs/**": true,
"**/.git/**": true,
"**/.tox/**": true
},
"git.rebaseWhenSync": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"gitlens.telemetry.enabled": false,
Expand All @@ -67,8 +61,6 @@
"search.exclude": {
"**/tests/**/__init__.py": true,
"**/uv.lock": true,
".github/workflows/cd.yml": true,
".github/workflows/ci.yml": true,
".taplo.toml": true,
"src/compwa_policy/.github/workflows/clean-caches.yml": true,
"src/compwa_policy/.github/workflows/pr-linting.yml": true,
Expand Down
11 changes: 2 additions & 9 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,18 @@ coverage:
status:
project:
default:
# basic
target: 0% # can't go below this percentage
threshold: 1% # allow drops by this percentage
target: 33%
threshold: 1%
base: auto
# advanced
branches: null
if_no_uploads: error
if_not_found: success
if_ci_failed: error
only_pulls: false
flags: null
paths: null
patch:
default:
# basic
target: 0
threshold: 5%
base: auto
# advanced
branches: null
if_no_uploads: error
if_not_found: success
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ commands = [
[
"pytest",
"{posargs}",
"--cov-fail-under=30",
"--cov-fail-under=33",
"--cov-report=html",
"--cov-report=xml",
"--cov=compwa_policy",
Expand Down
4 changes: 4 additions & 0 deletions src/compwa_policy/check_dev_files/github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ def __update_pytest_section(
with_section["additional-extras"] = " ".join(test_extras)
if CONFIG_PATH.codecov.exists():
with_section["coverage-target"] = __get_package_name()
secrets = {
"CODECOV_TOKEN": "${{ secrets.CODECOV_TOKEN }}",
}
config["jobs"]["pytest"]["secrets"] = secrets
if not no_macos:
with_section["macos-python-version"] = DoubleQuotedScalarString("3.9")
if skip_tests:
Expand Down

0 comments on commit ae3078c

Please sign in to comment.