From 3ebacee3d89a1a8c2b15f6a0ef7abcce48f1a81b Mon Sep 17 00:00:00 2001 From: owenjonesuob Date: Sun, 27 Dec 2020 14:46:22 +0000 Subject: [PATCH] Add cran-comments --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 2 -- README.md | 9 ++++++++- cran-comments.md | 13 +++++++++++++ tests/testthat/test-news.R | 12 +++++++----- 5 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 cran-comments.md diff --git a/.Rbuildignore b/.Rbuildignore index a52fd15..0357aab 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,3 +3,4 @@ ^LICENSE\.md$ ^\.github$ ^codecov\.yml$ +^cran-comments\.md$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 145f0dd..ce120c0 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -4,11 +4,9 @@ on: push: branches: - main - - master pull_request: branches: - main - - master name: R-CMD-check diff --git a/README.md b/README.md index 981193f..dcba4a7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,14 @@ Read R package news files, regardless of whether or not the package is currently ## Installation -You can install the latest version from GitHub using: +You can install the released version from CRAN using: + +```r +install.packages("pkgnews") +``` + + +Alternatively, you can install the latest version from GitHub using: ```r remotes::install_github("owenjonesuob/pkgnews") diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000..e18f2c0 --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,13 @@ +## Test environments + +* local R installation (Fedora 33), R 4.0.3 +* GitHub Actions (https://github.com/owenjonesuob/pkgnews/actions) +* win-builder (via `devtools::check_win_devel()`) +* R-hub (via `devtools::check_rhub()`) + + +## R CMD check results + +0 errors | 0 warnings | 1 note + +* This is a new release. diff --git a/tests/testthat/test-news.R b/tests/testthat/test-news.R index 674c575..9c3c494 100644 --- a/tests/testthat/test-news.R +++ b/tests/testthat/test-news.R @@ -56,18 +56,20 @@ test_that("web", { # Try a few CRAN packages skip_if(!nzchar(Sys.which("pandoc"))) - expect_equal( - tail(news("dplyr"), 1), - "download size from 2.8 MB to 0.5 MB." + expect_match( + # Drop zero-length elements with Filter(), in particular the last empty line! + tail(Filter(length, news("dplyr")), 1), + "download size from 2.8 MB to 0.5 MB.", + fixed = TRUE ) expect_equal( - tail(news("checkLuhn"), 1), + tail(Filter(length, news("checkLuhn")), 1), "- First release" ) expect_equal( - tail(news("goodpractice"), 1), + tail(Filter(length, news("goodpractice")), 1), "First public release." )