Skip to content

Commit

Permalink
Update codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
mhesselbarth committed Feb 11, 2025
1 parent e7d932f commit 241048b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 14 deletions.
42 changes: 35 additions & 7 deletions .github/workflows/Test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2-branch/examples
# 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, development]
Expand All @@ -10,26 +9,55 @@ on:

name: test-coverage

permissions: read-all

jobs:
test-coverage:
if: "!contains(github.event.commits[0].message, '[skip-ci]')"
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- 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
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: covr::codecov(quiet = FALSE)
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ knitr::opts_chunk$set(
| Development | CI | License |
|---|---|---|
| [![Project Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | [![R-CMD-check](https://github.com/Allgeier-Lab/arrR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Allgeier-Lab/arrR/actions/workflows/R-CMD-check.yaml) | [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) |
| [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable) | [![codecov](https://codecov.io/gh/Allgeier-Lab/arrR/branch/development/graph/badge.svg?token=Jx7R1vWP3s)](https://codecov.io/gh/Allgeier-Lab/arrR) | [![DOI](https://img.shields.io/badge/DOI-10.1002/eap.2617-blue.svg)](https://doi.org/10.1002/eap.2617) |

| [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable) | [![Codecov test coverage](https://codecov.io/gh/Allgeier-Lab/arrR/graph/badge.svg)](https://app.codecov.io/gh/Allgeier-Lab/arrR) | [![DOI](https://img.shields.io/badge/DOI-10.1002/eap.2617-blue.svg)](https://doi.org/10.1002/eap.2617) |
[![Codecov test coverage](https://codecov.io/gh/Allgeier-Lab/arrR/graph/badge.svg)](https://app.codecov.io/gh/Allgeier-Lab/arrR)
<!-- badges: end -->

The goal of **arrR** is to simulate seagrass primary production around artificial reefs (ARs). For a more detailed model description, please see `vignette("general-background")`. Please see `vignette("get-started")` for a short tutorial how to use **arrR**.
Expand Down
1 change: 1 addition & 0 deletions arrR.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 0b70d906-cc18-4208-be93-731836109db9

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
9 changes: 4 additions & 5 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ coverage:
status:
project:
default:
target: 80%
target: auto
threshold: 1%
informational: true
patch:
default:
target: 80%
target: auto
threshold: 1%

ignore:
- "inst/include"
informational: true

0 comments on commit 241048b

Please sign in to comment.