Skip to content

Commit

Permalink
update codecov for NFT
Browse files Browse the repository at this point in the history
  • Loading branch information
ericward-noaa committed Jun 11, 2024
1 parent e7d9d67 commit d0517ca
Show file tree
Hide file tree
Showing 19 changed files with 295 additions and 208 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^codecov\.yml$
5 changes: 5 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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

permissions: read-all

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

steps:
- 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, any::xml2
needs: coverage

- name: Test coverage
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_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
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
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ LinkingTo: BH (>= 1.66.0),
rstan (>= 2.18.1),
StanHeaders (>= 2.18.0)
Suggests:
testthat,
testthat (>= 3.0.0),
parallel,
knitr,
rmarkdown,
Expand All @@ -43,3 +43,4 @@ VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
SystemRequirements: GNU make
Biarch: true
Config/testthat/edition: 3
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
[![R-CMD-check](https://github.com/ericward-noaa/bycatch/workflows/R-CMD-check/badge.svg)](https://github.com/ericward-noaa/bycatch/actions)
<!-- badges: end -->

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

# bycatch
This is a repository for applications of Bayesian bycatch models, using Stan for estimation. These models fit Bayesian GLMs (with or without time varying parameters, and with or without covariates) to estimate bycatch rates. The package includes functions to estimate fleet-level estimates. The primary applications of these models (linked to below) are protected species bycatch (e.g. ESA listed birds, marine mammals) in the west coast groundfish fisheries off the west coast of the USA. Data compilation and analysis is done at the Northwest Fisheries Science Center (NWFSC) in Seattle. The pkgdown version of this site can be found here: [https://ericward-noaa.github.io/bycatch/](https://ericward-noaa.github.io/bycatch/)

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
2 changes: 1 addition & 1 deletion docs/articles/a01_overview.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/a02_fitting_models.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/a03_expanding_estimates.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/a04_diagnosing_problems.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ articles:
a02_fitting_models: a02_fitting_models.html
a03_expanding_estimates: a03_expanding_estimates.html
a04_diagnosing_problems: a04_diagnosing_problems.html
last_built: 2024-05-03T21:01Z
last_built: 2024-06-11T20:31Z

Loading

0 comments on commit d0517ca

Please sign in to comment.