Skip to content

Commit

Permalink
add codecov coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
calderonsamuel committed Aug 17, 2022
1 parent b711eed commit 39c05b8
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
^LICENSE\.md$
^CODE_OF_CONDUCT\.md$
^README\.Rmd$
^codecov\.yml$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
31 changes: 31 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Imports:
tibble,
tidyr
Suggests:
covr,
testthat (>= 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Expand Down
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ knitr::opts_chunk$set(
# perutranspaeconomica

<!-- badges: start -->
[![Codecov test coverage](https://codecov.io/gh/calderonsamuel/perutranspaeconomica/branch/main/graph/badge.svg)](https://app.codecov.io/gh/calderonsamuel/perutranspaeconomica?branch=main)
<!-- badges: end -->

El objetivo de `{perutranspaeconomica}` es contar con una manera de obtener datos del Portal de Transparencia Económica Perú desde R, con una interfaz de programación consistente y clara.
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# perutranspaeconomica

<!-- badges: start -->

[![Codecov test
coverage](https://codecov.io/gh/calderonsamuel/perutranspaeconomica/branch/main/graph/badge.svg)](https://app.codecov.io/gh/calderonsamuel/perutranspaeconomica?branch=main)
<!-- badges: end -->

El objetivo de `{perutranspaeconomica}` es contar con una manera de
Expand Down Expand Up @@ -89,7 +92,7 @@ make_gasto_query(year=2022, categoria_presupuestal = "0031", producto = "todos")
#> [1] "0031"
#>
#> $`31`
#> [1] "todos"
#> [1] ""
```

Como se puede ver, esto nos devuelve una lista nombrada en la que los
Expand All @@ -107,10 +110,10 @@ make_gasto_query(year=2022, categoria_presupuestal = "0031", producto = "todos")
#> 2 2022 2152344 MEJORAMIENTO … 1.81e4 1.81e4 0 0
#> 3 2022 2152345 MEJORAMIENTO … 1.57e4 1.57e4 0 0
#> 4 2022 2522056 ADQUISICION D… 0 2.3 e5 229900 0
#> 5 2022 3000001 ACCIONES COMU… 8.78e6 9.10e6 8118516 6407450
#> 6 2022 3000294 OPERACIONES D… 2.29e8 2.28e8 223609907 220168288
#> 5 2022 3000001 ACCIONES COMU… 8.78e6 9.10e6 8185102 6420329
#> 6 2022 3000294 OPERACIONES D… 2.29e8 2.28e8 225026326 220646110
#> 7 2022 3000490 HECTAREAS RED… 2.27e7 2.27e7 20280451 18243005
#> 8 2022 3000492 PROCESOS JUDI… 8.00e6 8.13e6 7361405 7337575
#> 8 2022 3000492 PROCESOS JUDI… 8.00e6 8.13e6 7406405 7382575
#> # … with 4 more variables: atencion_de_compromiso_mensual <dbl>,
#> # devengado <dbl>, girado <dbl>, avance_percent <dbl>
```
Expand Down
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true

0 comments on commit 39c05b8

Please sign in to comment.