Skip to content

Commit

Permalink
remove travis and add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
favstats committed Jul 13, 2021
1 parent a58cf32 commit ac23538
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
^codecov\.yml$
^prsp\.txt$
^LICENSE\.md$
Expand All @@ -15,4 +14,5 @@
^pkgdown$
^CODE_OF_CONDUCT\.md$
^README\.md$
^NEWS\.md$
^NEWS\.md$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
85 changes: 85 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# peRspective <img src="man/figures/perspective.png" width="160px" align="right"/>

[![](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)
Expand Down Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.


0 comments on commit ac23538

Please sign in to comment.