diff --git a/.Rbuildignore b/.Rbuildignore index 480c43f..433f374 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,6 +1,5 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -^\.travis\.yml$ ^codecov\.yml$ ^prsp\.txt$ ^LICENSE\.md$ @@ -15,4 +14,5 @@ ^pkgdown$ ^CODE_OF_CONDUCT\.md$ ^README\.md$ -^NEWS\.md$ \ No newline at end of file +^NEWS\.md$ +^\.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..cea7ca2 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,85 @@ +# 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 +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +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: windows-latest, r: 'release'} + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" } + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + + - uses: r-lib/actions/setup-pandoc@v1 + + - 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} + + - name: Restore R package cache + uses: actions/cache@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 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") + shell: Rscript {0} + + - name: Check + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: | + options(crayon.enabled = TRUE) + rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + shell: Rscript {0} + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@main + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 612c1ac..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r - -language: R -cache: packages - -jobs: - include: - - r: release - warnings_are_errors: true - - r: devel - warnings_are_errors: true - -r_packages: - - covr - -after_success: - - Rscript -e 'library(covr); codecov()' - -before_deploy: Rscript -e 'remotes::install_cran("pkgdown")' -deploy: - provider: script - script: Rscript -e 'pkgdown::deploy_site_github()' - skip_cleanup: true \ No newline at end of file diff --git a/NEWS.md b/NEWS.md index fcbb803..b25e114 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,8 @@ # peRspective 0.1.1 -* Turn sleeps below 0.7 intervals only into a warning as to give more choice to the user if they have a better API quota. +* Turned sleeps below 0.7 intervals into a warning (rather than error) as to give more choice to the user if they have a better API quota. -* Fix bug where it would sometimes not correctly match the `text_id` due to one being numeric. Now always outputs character. +* Fixed bug where it would sometimes not correctly match the `text_id` due to one variable being numeric. Now always outputs character. # peRspective 0.1.0 (2019-05-17) diff --git a/README.Rmd b/README.Rmd index 865a372..2add01c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -27,12 +27,13 @@ library(dplyr) library(badger) + git_repo <- "favstats/peRspective" cat( "[![](https://cranlogs.r-pkg.org/badges/grand-total/peRspective)](https://cran.rstudio.com/web/packages/peRspective/index.html)", + " [![R-CMD-check](https://github.com/favstats/peRspective/workflows/R-CMD-check/badge.svg)](https://github.com/favstats/peRspective/actions)", # badge_custom("My 1st Package", "Ever", "blue"), - badge_travis(git_repo), badge_cran_release("peRspective", "blue"), "[![Codecov test coverage](https://codecov.io/gh/favstats/peRspective/branch/master/graph/badge.svg)](https://codecov.io/gh/favstats/peRspective?branch=master)", badge_code_size(git_repo), diff --git a/README.md b/README.md index 1028df1..622c559 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # peRspective [![](https://cranlogs.r-pkg.org/badges/grand-total/peRspective)](https://cran.rstudio.com/web/packages/peRspective/index.html) -[![](https://travis-ci.org/favstats/peRspective.svg?branch=master)](https://travis-ci.org/favstats/peRspective) +[![R-CMD-check](https://github.com/favstats/peRspective/workflows/R-CMD-check/badge.svg)](https://github.com/favstats/peRspective/actions) [![](https://www.r-pkg.org/badges/version/peRspective?color=blue)](https://cran.r-project.org/package=peRspective) [![Codecov test coverage](https://codecov.io/gh/favstats/peRspective/branch/master/graph/badge.svg)](https://codecov.io/gh/favstats/peRspective?branch=master) @@ -395,53 +395,53 @@ text_sample %>% Or the (not as pretty) output in Markdown - #> 11.11% [2021-07-13 00:25:25]: 1 out of 9 (11.11%) + #> 11.11% [2021-07-13 11:15:16]: 1 out of 9 (11.11%) #> text_id: #efdcxct #> 0.96 TOXICITY #> 0.85 SEVERE_TOXICITY #> - #> 22.22% [2021-07-13 00:25:26]: 2 out of 9 (22.22%) + #> 22.22% [2021-07-13 11:15:17]: 2 out of 9 (22.22%) #> text_id: #ehfcsct #> 0.93 TOXICITY #> 0.53 SEVERE_TOXICITY #> - #> 33.33% [2021-07-13 00:25:28]: 3 out of 9 (33.33%) + #> 33.33% [2021-07-13 11:15:18]: 3 out of 9 (33.33%) #> text_id: #ekacxwt #> ERROR #> Error in .f(...): HTTP 400 #> INVALID_ARGUMENT: Comment must be non-empty. #> NO SCORES #> - #> 44.44% [2021-07-13 00:25:29]: 4 out of 9 (44.44%) + #> 44.44% [2021-07-13 11:15:19]: 4 out of 9 (44.44%) #> text_id: #ewatxad #> 0.07 TOXICITY #> 0.02 SEVERE_TOXICITY #> - #> 55.56% [2021-07-13 00:25:30]: 5 out of 9 (55.56%) + #> 55.56% [2021-07-13 11:15:20]: 5 out of 9 (55.56%) #> text_id: #ekacswt #> 0.60 TOXICITY #> 0.32 SEVERE_TOXICITY #> - #> 66.67% [2021-07-13 00:25:31]: 6 out of 9 (66.67%) + #> 66.67% [2021-07-13 11:15:22]: 6 out of 9 (66.67%) #> text_id: #ewftxwd #> 0.07 TOXICITY #> 0.03 SEVERE_TOXICITY #> - #> 77.78% [2021-07-13 00:25:32]: 7 out of 9 (77.78%) + #> 77.78% [2021-07-13 11:15:23]: 7 out of 9 (77.78%) #> text_id: #eeadswt #> 0.14 TOXICITY #> 0.09 SEVERE_TOXICITY #> - #> 88.89% [2021-07-13 00:25:33]: 8 out of 9 (88.89%) + #> 88.89% [2021-07-13 11:15:24]: 8 out of 9 (88.89%) #> text_id: #enfhxed #> 0.35 TOXICITY #> 0.14 SEVERE_TOXICITY #> - #> 100.00% [2021-07-13 00:25:34]: 9 out of 9 (100.00%) + #> 100.00% [2021-07-13 11:15:25]: 9 out of 9 (100.00%) #> text_id: #efdmjd #> ERROR #> Error in .f(...): HTTP 400 - #> INVALID_ARGUMENT: Attribute TOXICITY does not support request languages: ja-Latn + #> INVALID_ARGUMENT: Attribute SEVERE_TOXICITY does not support request languages: ja-Latn #> NO SCORES #> # A tibble: 9 x 4 #> text_id error TOXICITY SEVERE_TOXICITY diff --git a/cran-comments.md b/cran-comments.md index 558a312..05870f7 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,14 +1,16 @@ ## Release summary -This is a minor release in the 0.1 series. +This is a patch release in the 0.1 series. ## Test environments -* local OS X install, R 3.6.0 -* ubuntu 14.04 (on travis-ci), R 3.6.0 +* GitHub Actions windows-latest, r: 'release' +* GitHub Actions macOS-latest, r: 'release' +* GitHub Actions ubuntu-20.04, r: 'release' +* GitHub Actions ubuntu-20.04, r: 'devel' * win-builder (devel and release) -* R-hub windows-x86_64-devel (r-devel) -* R-hub ubuntu-gcc-release (r-release) -* R-hub fedora-clang-devel (r-devel) +* R-hub Windows Server 2008 R2 SP1, R-devel, 32/64 bit +* R-hub Ubuntu Linux 20.04.1 LTS, R-release, GCC +* R-hub Fedora Linux, R-devel, clang, gfortran ## R CMD check results There were no NOTEs, ERRORs or WARNINGs @@ -19,8 +21,8 @@ There are currently no downstream dependencies for this package. ## Resubmission This is a resubmission. In this version I have: -* Turned sleeps below 0.7 intervals only into a warning as to give more choice to the user if they have a better API quota. +* Turned sleeps below 0.7 intervals into a warning (rather than error) as to give more choice to the user if they have a better API quota. -* Fixed a bug where it would sometimes not correctly match the `text_id` due to one being numeric. Now always outputs character +* Fixed bug where it would sometimes not correctly match the `text_id` due to one variable being numeric. Now always outputs character.