From 08222b82475c3b0e1fa7d74c2a00632257df628a Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 22 Mar 2023 10:38:28 +0200 Subject: [PATCH] Update gitignore and DESCRIPTION, add testing workflow --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 50 ++++++++++++++++++++++++++++++ .gitignore | 1 - DESCRIPTION | 11 ++++--- NAMESPACE | 3 +- R/bayes4psy-package.R | 3 +- README.md | 3 ++ inst/include/stan_meta_header.hpp | 1 + 9 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 inst/include/stan_meta_header.hpp diff --git a/.Rbuildignore b/.Rbuildignore index 6f55499..e206297 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,3 +6,4 @@ cran-comments.md ^doc$ ^Meta$ ^CRAN-RELEASE$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..600f7ac --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,50 @@ +# 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] + pull_request: + branches: [main, master, develop] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - 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@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + error-on: '"error"' diff --git a/.gitignore b/.gitignore index 06bacdc..cf4f1c4 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,5 @@ vignettes/*.pdf *.o *.so *.cc -*.hpp doc Meta diff --git a/DESCRIPTION b/DESCRIPTION index 1e7072d..d4506f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,8 +30,9 @@ Imports: mcmcse (>= 1.4.1), scales (>= 1.1.1), stats (>= 4.0.0), - utils (>= 4.0.0) -Suggests: + utils (>= 4.0.0), + RcppParallel +Suggests: testthat (>= 3.0.0), rmarkdown (>= 2.5.0), knitr (>= 1.30.0) @@ -40,10 +41,12 @@ LinkingTo: rstan (>= 2.21.0), BH (>= 1.72.0.3), Rcpp (>= 1.0.5), - RcppEigen (>= 0.3.3.7.0) + RcppEigen (>= 0.3.3.7.0), + RcppParallel SystemRequirements: GNU make VignetteBuilder: knitr NeedsCompilation: yes -RoxygenNote: 7.2.1 +UseLTO: true +RoxygenNote: 7.2.3 URL: https://github.com/bstatcomp/bayes4psy BugReports: https://github.com/bstatcomp/bayes4psy/issues diff --git a/NAMESPACE b/NAMESPACE index 1d848f0..cf2e3c6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -32,6 +32,7 @@ import(dplyr) import(ggplot2) import(methods) import(rstan) -import(rstantools) +importFrom(RcppParallel,RcppParallelLibs) importFrom(rstan,sampling) +importFrom(rstantools,rstan_config) useDynLib(bayes4psy, .registration = TRUE) diff --git a/R/bayes4psy-package.R b/R/bayes4psy-package.R index 504881e..3074171 100644 --- a/R/bayes4psy-package.R +++ b/R/bayes4psy-package.R @@ -8,7 +8,8 @@ #' @useDynLib bayes4psy, .registration = TRUE #' @import methods #' @import Rcpp -#' @import rstantools +#' @importFrom rstantools rstan_config +#' @importFrom RcppParallel RcppParallelLibs #' @importFrom rstan sampling #' #' @references diff --git a/README.md b/README.md index 1ac550f..d91309f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # bayes4psy—User Friendly Bayesian Data Analysis for Psychology + +[![R-CMD-check](https://github.com/bstatcomp/bayes4psy/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bstatcomp/bayes4psy/actions/workflows/R-CMD-check.yaml) [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/bayes4psy?color=blue)](https://CRAN.R-project.org/package=bayes4psy)[![Downloads](http://cranlogs.r-pkg.org/badges/bayes4psy?color=blue)](https://CRAN.R-project.org/package=bayes4psy) + ## Authors diff --git a/inst/include/stan_meta_header.hpp b/inst/include/stan_meta_header.hpp new file mode 100644 index 0000000..3b914da --- /dev/null +++ b/inst/include/stan_meta_header.hpp @@ -0,0 +1 @@ +// Insert all #include statements here