Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 5 additions & 38 deletions .github/workflows/build-pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@
on:
workflow_call:
inputs:
build_testdown:
description: 'Generate testdown report?'
required: false
type: boolean
default: false
build_code_coverage:
description: 'Generate code coverage report?'
required: false
type: boolean
default: false
is_main_push:
type: boolean
default: false
Expand All @@ -28,7 +18,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -40,44 +30,21 @@ jobs:
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build pkgdown site
env:
INPUT_TESTDOWN: ${{ inputs.build_testdown }}
INPUT_CODE_COVERAGE: ${{ inputs.build_code_coverage }}
R_KEEP_PKG_SOURCE: "yes"
TESTTHAT_PROGRESS: "plain"
R_BACKTRACE_ON_ERROR: "full"
run: |
reports_to_build <- c()
if (Sys.getenv("INPUT_TESTDOWN") == 'true') {
reports_to_build <- c(reports_to_build, "testdown")
}
if (Sys.getenv("INPUT_CODE_COVERAGE") == 'true') {
reports_to_build <- c(reports_to_build, "coverage")
}
if (length(reports_to_build) > 0) {
lozen::build_pkgdown_with_reports(
pkg = ".",
pkgdown_path = "docs",
assets_path = "pkgdown/assets",
reports = reports_to_build
)
} else {
pkgdown::build_site(
override = list(destination = "docs")
)
}
pkgdown::build_site(override = list(destination = "docs"))
shell: Rscript {0}

- name: Save pkgdown output
uses: actions/upload-artifact@v7
with:
name: pkgdown-site-with-reports
name: pkgdown-site
path: docs/

- name: Deploy package
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
publish_dir: ./docs
59 changes: 40 additions & 19 deletions .github/workflows/call-calc_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Runs covr::codecov() to calculate code coverage.
# Runs covr::package_coverage() to calculate code coverage and uploads to Codecov.
name: call-calc_coverage

on:
pull_request:
branches:
Expand All @@ -15,22 +14,44 @@ on:
- 'LICENSE'
- 'man'
- 'README.md'
push:
branches:
- dev
paths-ignore:
- .devcontainer
- .github
- '.gitignore'
- '.Rbuildignore'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'man'
- 'README.md'
workflow_dispatch:

# Cancel active CI runs for a PR before starting another run
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
call-workflow:
uses: nmfs-ost/ghactions4r/.github/workflows/calc-coverage.yml@main
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
calc-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v5

- 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: Calculate 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}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
fail_ci_if_error: true
4 changes: 1 addition & 3 deletions .github/workflows/call-update-pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ jobs:
call-workflow:
uses: ./.github/workflows/build-pkgdown.yml
with:
build_testdown: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
build_code_coverage: false
is_main_push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
is_main_push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
5 changes: 0 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,12 @@ Imports:
tidyr
Suggests:
knitr,
lozen,
purrr,
rmarkdown,
testdown,
testthat (>= 3.0.0),
utils
VignetteBuilder:
knitr
Remotes:
github::ThinkR-open/lozen,
github::ThinkR-open/testdown
Config/roxygen2/version: 8.0.0
Config/testthat/edition: 3
Config/testthat/parallel: false
Expand Down
2 changes: 2 additions & 0 deletions vignettes/a2_meta.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ filtered_traits <- dplyr::filter(
Number > 0,
trait %in% c("LengthMax")
)

filtered_traits$study_id <- seq_len(nrow(filtered_traits))
```

### Variance weighting
Expand Down
Loading