diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index d8ae294..62a2469 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,16 +1,12 @@ -# NOTE: This workflow is overkill for most R packages -# check-standard.yaml is likely a better choice -# usethis::use_github_action("check-standard") will install it. -# -# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. -# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +# 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: - - master + - [main, master, development] pull_request: branches: - - master + - [main, master, development] name: R-CMD-check @@ -25,80 +21,36 @@ jobs: matrix: config: - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'devel', http-user-agent: 'release'} - {os: windows-latest, r: 'release'} - - {os: windows-latest, r: '3.6'} - - {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } - - {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} - - {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"} + - {os: windows-latest, r: 'oldrel'} + - {os: ubuntu-20.04, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-20.04, r: 'release'} + - {os: ubuntu-20.04, r: 'oldrel'} env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v2 with: + Ncpus: 2 r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - - - uses: r-lib/actions/setup-pandoc@master - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} + use-public-rspm: false - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")') - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash + extra-packages: | + any::rcmdcheck + any::Rcpp + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 15178f3..2c820d4 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,10 +1,12 @@ on: push: branches: + - main - master - development pull_request: branches: + - main - master - development @@ -20,30 +22,17 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-pandoc@master - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} + - uses: r-lib/actions/setup-r@v2 + with: + Ncpus: 2 + use-public-rspm: false - - name: Cache R packages - uses: actions/cache@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies - run: | - install.packages(c("remotes")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - shell: Rscript {0} + extra-packages: | + any::covr - name: Test coverage run: covr::codecov() diff --git a/DESCRIPTION b/DESCRIPTION index b3042ad..3db95af 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -10,6 +10,7 @@ Authors@R: c( ) URL: https://github.com/achubaty/meow BugReports: https://github.com/achubaty/meow/issues +Encoding: UTF-8 License: GPL Depends: R (>= 3.1.2) @@ -20,4 +21,5 @@ Imports: Suggests: covr, testthat -RoxygenNote: 6.0.1 +RoxygenNote: 7.3.1 +Roxygen: list(markdown = TRUE) diff --git a/R/meow-package.R b/R/meow-package.R new file mode 100644 index 0000000..ca288b0 --- /dev/null +++ b/R/meow-package.R @@ -0,0 +1,14 @@ +# +# meow by Alex M Chubaty and Kiri Whan +# Copyright (C) 2015-2024 +# + +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +#' @importFrom graphics plot +#' @importFrom jpeg readJPEG +#' @importFrom utils download.file +## usethis namespace: end +NULL diff --git a/R/meow.R b/R/meow.R index b6782b0..15698ca 100644 --- a/R/meow.R +++ b/R/meow.R @@ -1,35 +1,12 @@ -# -# meow by Alex M Chubaty and Kiri Whan -# Copyright (C) 2015-2020 -# - -#' Get random pictures of cats. Meow! -#' -#' Queries \url{https://thecatapi.com} for cute cat photos and displays them in your R session. -#' -#' Bug reports: \url{https://github.com/achubaty/meow/issues} -#' -#' @name meow-package -#' @docType package -#' @author Alex M. Chubaty \email{alex.chubaty@@gmail.com} -#' @author Kiri Whan \email{kiriwhan@@gmail.com} -#' @keywords package -NULL - - - #' Download and display a random picture of a cat. #' -#' Downloads and plots a random cat image (jpg) from \url{https://thecatapi.com}. +#' Downloads and plots a random cat image (jpg) from . #' -#' @return Invisibly returns logical, \code{TRUE} indicating success. +#' @return Invisibly returns logical, `TRUE` indicating success. #' Invoked for its side effect of displaying a cat picture. #' #' @author Alex Chubaty and Kiri Whan #' @export -#' @importFrom graphics plot -#' @importFrom jpeg readJPEG -#' @importFrom utils download.file #' #' @examples #' meow() diff --git a/man/meow-package.Rd b/man/meow-package.Rd index f2a4754..f694521 100644 --- a/man/meow-package.Rd +++ b/man/meow-package.Rd @@ -1,17 +1,27 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/meow.R +% Please edit documentation in R/meow-package.R \docType{package} \name{meow-package} \alias{meow-package} -\title{Get random pictures of cats. Meow!} +\title{meow: Get Random Pictures of Cats} \description{ -Queries \url{http://thecatapi.com} for cute cat photos and displays them in yor R session. +Queries http://thecatapi.com for cute cat photos and displays them in yor R session. Meow! +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/achubaty/meow} + \item Report bugs at \url{https://github.com/achubaty/meow/issues} +} -Bug reports: https://github.com/achubaty/meow/issues } \author{ -Alex M. Chubaty \email{alex.chubaty@gmail.com} +\strong{Maintainer}: Alex M Chubaty \email{alex.chubaty@gmail.com} + +Authors: +\itemize{ + \item Kiri Whan \email{kiriwhan@gmail.com} +} -Kiri Whan\email{kiriwhan@gmail.com} } -\keyword{package} +\keyword{internal} diff --git a/man/meow.Rd b/man/meow.Rd index ff36c7a..380a771 100644 --- a/man/meow.Rd +++ b/man/meow.Rd @@ -8,10 +8,10 @@ meow() } \value{ Invisibly returns logical, \code{TRUE} indicating success. - Invoked for its side effect of displaying a cat picture. +Invoked for its side effect of displaying a cat picture. } \description{ -Downloads and plots a random cat image (jpg) from \url{http://thecatapi.com}. +Downloads and plots a random cat image (jpg) from \url{https://thecatapi.com}. } \examples{ meow() diff --git a/meow.Rproj b/meow.Rproj index 497f8bf..f0d6187 100644 --- a/meow.Rproj +++ b/meow.Rproj @@ -18,3 +18,4 @@ StripTrailingWhitespace: Yes BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace,vignette