From dc53588b0e8e4d951e075dc40f2bd14454f445b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20S=C3=B8rensen?= Date: Tue, 2 Jul 2024 19:54:42 +0200 Subject: [PATCH 1/3] adding more to the workflow --- .github/workflows/R-CMD-check.yaml | 26 +++++++++------ .github/workflows/test-coverage.yaml | 47 +++++++++++++++++++++++----- README.Rmd | 1 + 3 files changed, 56 insertions(+), 18 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 16698ea..0f2fe08 100755 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,13 +1,15 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/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, master, develop] + branches: [main, master] pull_request: - branches: [main, master, develop] + branches: [main, master] name: R-CMD-check +permissions: read-all + jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} @@ -18,7 +20,7 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} + - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} @@ -29,18 +31,22 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: rcmdcheck + extra-packages: any::rcmdcheck + needs: check - - uses: r-lib/actions/check-r-package@v1 + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 084a108..fefc52e 100755 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,13 +1,15 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/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, master, develop] + branches: [main, master] pull_request: - branches: [main, master, develop] + branches: [main, master] name: test-coverage +permissions: read-all + jobs: test-coverage: runs-on: ubuntu-latest @@ -15,16 +17,45 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: covr + extra-packages: any::covr, any::xml2 + needs: coverage - name: Test coverage - run: covr::codecov() + 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 diff --git a/README.Rmd b/README.Rmd index 51a8bf2..6b8e105 100755 --- a/README.Rmd +++ b/README.Rmd @@ -21,6 +21,7 @@ devtools::load_all(".") [![R-CMD-check](https://github.com/Lifebrain/metagam/workflows/R-CMD-check/badge.svg)](https://github.com/Lifebrain/metagam/actions) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![Codecov test coverage](https://codecov.io/gh/Lifebrain/metagam/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Lifebrain/metagam?branch=master) +[![R-CMD-check](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml) From c6a753cc67c49d76b6da7e8b3646bc5ea148020e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20S=C3=B8rensen?= Date: Tue, 2 Jul 2024 19:54:58 +0200 Subject: [PATCH 2/3] compiling readme --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 773ae14..4c6faf1 100755 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ status](https://www.r-pkg.org/badges/version/metagam)](https://CRAN.R-project.or experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) [![Codecov test coverage](https://codecov.io/gh/Lifebrain/metagam/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Lifebrain/metagam?branch=master) +[![R-CMD-check](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Lifebrain/metagam/actions/workflows/R-CMD-check.yaml) ## Overview @@ -31,10 +32,10 @@ Zanobetti (2000) and Crippa, Thomas, and Orsini (2018). Currently, GAMs objects created with the following functions are supported: -- From package [mgcv](https://cran.r-project.org/package=mgcv): - `bam()`, `gam()` and `gamm()`. -- From package [gamm4](https://cran.r-project.org/package=gamm4): - `gamm4()`. +- From package [mgcv](https://cran.r-project.org/package=mgcv): `bam()`, + `gam()` and `gamm()`. +- From package [gamm4](https://cran.r-project.org/package=gamm4): + `gamm4()`. This package is under development, so changes to the interface can be expected. Suggestions for improvements and bug reports are warmly @@ -65,7 +66,7 @@ remotes::install_github("lifebrain/metagam") library("metagam") library("mgcv") #> Loading required package: nlme -#> This is mgcv 1.8-38. For overview type 'help("mgcv-package")'. +#> This is mgcv 1.9-1. For overview type 'help("mgcv-package")'. ``` Simulate three datasets and fit a GAM to each of them. Then use @@ -91,7 +92,7 @@ participant data. We can then meta-analyze them using `metagam()`. ``` r meta_analysis <- metagam(models) summary(meta_analysis) -#> Meta-analysis of GAMs from 3 cohorts, using method FE. +#> Meta-analysis of GAMs from cohorts, using method FE. #> #> Smooth terms analyzed: s(x2). ``` @@ -108,7 +109,8 @@ By contributing to this project, you agree to abide by its terms. ## References -
+
From 8cb9529ef0d76db5bdf5d71aee3e1dbd1b2037e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20S=C3=B8rensen?= Date: Wed, 3 Jul 2024 08:03:48 +0200 Subject: [PATCH 3/3] fixing docs and dependencies --- DESCRIPTION | 2 +- R/metagam_package.R | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1d17f92..866da1a 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -31,7 +31,7 @@ Imports: ggplot2, metafor, rlang -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Suggests: roxygen2, knitr, diff --git a/R/metagam_package.R b/R/metagam_package.R index d1147ec..9a6b15e 100755 --- a/R/metagam_package.R +++ b/R/metagam_package.R @@ -14,8 +14,7 @@ #' \code{\link{plot_heterogeneity}} can be used to study the meta-analytic fit #' computed by \code{\link{strip_rawdata}}. #' -#' @docType package #' @name metagam-package #' #' @importFrom rlang .data -NULL +"_PACKAGE"