Skip to content

Commit 3ae3fd7

Browse files
authored
feat: add upload to codecov.io #21
feat: add upload to codecov.io
2 parents 0f37467 + 0b9586c commit 3ae3fd7

6 files changed

Lines changed: 31 additions & 3 deletions

File tree

.github/linters/.lycheeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Dead irrelevant path in pkgdown/favicon
22
http://svgjs.dev/svgjs
3+
# Path to RSPM yet to be derived
4+
https://packagemanager.posit.co/cran/$%7B%7Bmatrix.config.date

.github/linters/.mega-linter.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
APPLY_FIXES: all
22
DISABLE_LINTERS:
33
- REPOSITORY_GIT_DIFF
4+
- REPOSITORY_CHECKOV
45
ADDITIONAL_EXCLUDED_DIRECTORIES:
56
- dev
7+
REPOSITORY_KICS_ARGUMENTS: "--exclude-queries 555ab8f9-2001-455e-a077-f2d0f41e2fb9"
68
SPELL_LYCHEE_ARGUMENTS: "--exclude-path man/figures --exclude-path docs --exclude-path pkgdown/favicon"
79
SPELL_LYCHEE_FILE_EXTENSIONS:
810
- "*"

.github/workflows/coverage.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
workflow_dispatch:
1313
workflow_call:
1414
inputs:
15+
use_codecov:
16+
description: Upload code coverage results to codecov.io
17+
required: false
18+
type: boolean
19+
default: false
1520
use_local_setup_action:
1621
description: Use composite .github/actions/setup/action.yaml to setup package specific needs
1722
required: false
@@ -21,7 +26,7 @@ permissions:
2126
contents: read
2227
pull-requests: write
2328
jobs:
24-
test-coverage-internal:
29+
test-coverage:
2530
runs-on: ubuntu-latest
2631
steps:
2732
- uses: actions/checkout@v4
@@ -75,3 +80,12 @@ jobs:
7580
recreate: true
7681
header: coverage
7782
path: coverage.md
83+
- name: Upload coverage reports to Codecov
84+
if: ${{ inputs.use_codecov }}
85+
uses: codecov/codecov-action@v5
86+
with:
87+
fail_ci_if_error: true
88+
files: "./cobertura.xml"
89+
token: ${{ secrets.CODECOV_TOKEN }}
90+
slug: ${{ github.repository }}
91+
verbose: true

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: r.workflows
22
Title: R package workflows
3-
Version: 0.0.1.9000
3+
Version: 0.0.1.9001
44
Authors@R: c(
55
person("Cervan", "Girard", , "cgid@novonordisk.com", role = c("aut", "cre")),
66
person("Aksel", "Thomsen", , "oath@novonordisk.com", role = c("aut"))

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ It contains the following workflows:
66

77
1. [R-CMD-check standard](.github/workflows/check_current_version.yaml): Standard R CMD check, that checks the package for current version of R on MacOs and Windows, and for the previous, current, and development version of R on Linux.
88
2. [R-CMD-check NN versions](.github/workflows/check_nn_versions.yaml): Same as 1., but uses the R version and packages available as per given lock dates.
9-
3. [Test coverage](.github/workflows/coverage.yaml): Derives test coverage for the package and publishes a summary table to the pull request.
9+
3. [Test coverage](.github/workflows/coverage.yaml): Derives test coverage for the package and publishes a summary table to the pull request. For Open-Source repositories this also gives you the option to upload code coverage results to [codecov.io](https://codecov.io).
1010
4. [pkgdown](.github/workflows/pkgdown.yaml): Renders and publishes a `pkgdown` website for your package (to your `gh-pages` branch). For a pull request the page is published to `{base url of package}/dev/{pr number}`, and a link to this development webpage is posted as a comment to your pull request.
1111
5. [megalinter](.github/workflows/megalinter.yaml): Lints your entire project using the [megalinter](https://megalinter.io/) tool. Note that for the [cspell](https://github.com/streetsidesoftware/cspell) linter words in `inst/WORDLIST` are automatically added as a dictionary if the file exists.
1212

@@ -43,6 +43,9 @@ jobs:
4343
coverage:
4444
name: Coverage report
4545
uses: NovoNordisk-OpenSource/r.workflows/.github/workflows/coverage.yaml@main
46+
secrets: inherit # Required if use_code below is true, in order to access organisational codecov token
47+
with:
48+
use_codecov: false # Change to true if you want to upload coverage results to codecov.io.
4649
megalinter:
4750
name: Megalinter
4851
uses: NovoNordisk-OpenSource/r.workflows/.github/workflows/megalinter.yaml@main

inst/WORDLIST

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Aksel
2+
Cervan
3+
Girard
4+
roxygen
5+
Roxygen
6+
testthat
7+
Thomsen

0 commit comments

Comments
 (0)