Skip to content

Commit

Permalink
Refresh ghapi3 package (#8)
Browse files Browse the repository at this point in the history
* Update package level documentation

* Update DESCRIPTION file

* Re-build documentation

* Remove TravisCI

* Add R CMD Check

* Add GitHub Actions

* Update README format
  • Loading branch information
coatless authored Jan 5, 2020
1 parent 9c604da commit 5aa165f
Show file tree
Hide file tree
Showing 17 changed files with 242 additions and 70 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on: [push, pull_request]

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: windows-latest, r: 'devel'}
- { os: macOS-latest, r: 'release'}
- { os: macOS-latest, r: 'devel'}
- { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- { os: ubuntu-16.04, r: 'release', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}

steps:
- uses: actions/checkout@v1

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }}

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "install.packages('remotes')" -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: Rscript -e "install.packages('remotes')" -e "remotes::install_deps(dependencies = TRUE)" -e "remotes::install_cran('rcmdcheck')"

- name: Check
run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')"

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

#- name: Test coverage
# if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'release'
# run: |
# Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
47 changes: 47 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
issue_comment:
types: [created]
name: Commands
jobs:
document:
if: startsWith(github.event.comment.body, '/document')
name: document
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
- name: commit
run: |
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
style:
if: startsWith(github.event.comment.body, '/style')
name: document
runs-on: macOS-latest
steps:
- uses: actions/checkout@master
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
- name: style
run: Rscript -e 'styler::style_pkg()'
- name: commit
run: |
git add \*.R
git commit -m 'style'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

26 changes: 16 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
Package: ghapi3
Title: GitHub v3 API Implementation
Version: 0.0.1
Authors@R: c(person("James", "Balamuta",
email = "balamut2@illinois.edu", role = c("aut", "cre", "cph")),
person("GitHub", "Inc.", email = "support@github.com", role = c("cph")))
Description: Provides access to GitHub API v3.0 using the gh package backend.
URL: https://github.com/coatless/ghapi
BugReports: https://github.com/coatless/ghapi/issues
Authors@R: c(
person("James", "Balamuta",
email = "balamut2@illinois.edu",
role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0003-2826-8458")),
person("GitHub", "Inc.",
email = "support@github.com", role = c("cph"))
)
Description: Provides access to select GitHub API v3.0 endpoints using
the 'gh' package backend.
License: GPL (>= 2)
URL: https://github.com/coatless/ghapi3
BugReports: https://github.com/coatless/ghapi3/issues
Depends: R (>= 3.4.0)
Imports: gh
License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
Suggests: covr,
testthat
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.0.2
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ghapi3 0.0.1

## Deployment

- CI is done using GitHub Actions.
7 changes: 7 additions & 0 deletions R/ghapi3-package.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#' @keywords internal
#' @details
#' This package requires users have access to a GitHub Personal Access Token (PAT)
"_PACKAGE"

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
## usethis namespace: end
NULL
18 changes: 10 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,30 @@ knitr::opts_chunk$set(
```


[![Travis-CI Build Status](https://travis-ci.org/coatless/ghapi3.svg?branch=master)](https://travis-ci.org/coatless/ghapi3)
<!-- badges: start -->
[![R build
status](https://github.com/coatless/ghapi3/workflows/R-CMD-check/badge.svg)](https://github.com/coatless/ghapi3/actions)
[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/ghapi3)](http://www.r-pkg.org/pkg/ghapi3)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/ghapi3)](https://cran.r-project.org/package=ghapi3)
[![Coverage Status](https://img.shields.io/codecov/c/github/coatless/ghapi3/master.svg)](https://codecov.io/github/coatless/ghapi3?branch=master)
<!-- badges: end -->


# `ghapi3`
## ghapi3

The goal of `ghapi3` is to provide a full-featured interface to GitHub's API v3.0.
To do this, we use the [`gh`](https://github.com/r-lib/gh) _R_ package to
access the GitHub API's methods.

## Installation
### Installation

You can install `ghapi3` from github with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("coatless/ghapi3")
if(!requireNamespace("remotes", quietly = TRUE)) { install.packages("remotes") }
remotes::install_github("coatless/ghapi3")
```

## Implementation
### Implementation

We have support presently for:

Expand All @@ -53,6 +55,6 @@ knitr::kable(funcs)
```


## License
### License

GPL (>= 2)
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

[![Travis-CI Build
Status](https://travis-ci.org/coatless/ghapi3.svg?branch=master)](https://travis-ci.org/coatless/ghapi3)
<!-- badges: start -->

[![R build
status](https://github.com/coatless/ghapi3/workflows/R-CMD-check/badge.svg)](https://github.com/coatless/ghapi3/actions)
[![CRAN RStudio mirror
downloads](http://cranlogs.r-pkg.org/badges/ghapi3)](http://www.r-pkg.org/pkg/ghapi3)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/ghapi3)](https://cran.r-project.org/package=ghapi3)
[![Coverage
Status](https://img.shields.io/codecov/c/github/coatless/ghapi3/master.svg)](https://codecov.io/github/coatless/ghapi3?branch=master)
<!-- badges: end -->

# `ghapi3`
## ghapi3

The goal of `ghapi3` is to provide a full-featured interface to GitHub’s
API v3.0. To do this, we use the [`gh`](https://github.com/r-lib/gh) *R*
package to access the GitHub API’s methods.

## Installation
### Installation

You can install `ghapi3` from github with:

``` r
# install.packages("devtools")
devtools::install_github("coatless/ghapi3")
if(!requireNamespace("remotes", quietly = TRUE)) { install.packages("remotes") }
remotes::install_github("coatless/ghapi3")
```

## Implementation
### Implementation

We have support presently for:

Expand All @@ -36,11 +39,11 @@ We have support presently for:
| browse\_commit\_diff |
| check\_org\_private\_membership |
| check\_org\_public\_membership |
| create\_commit\_diff\_url |
| create\_org\_invitation\_email |
| create\_org\_invitation\_ghname |
| create\_org\_repo |
| create\_tag |
| create\_url\_commit\_diff |
| create\_user\_repo |
| get\_collaborator\_list |
| get\_contributors\_list |
Expand All @@ -59,6 +62,6 @@ We have support presently for:
| transfer\_repo |
| update\_org\_member\_role |

## License
### License

GPL (\>= 2)
8 changes: 6 additions & 2 deletions man/add_collaborator.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/get_collaborator_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/get_org_members_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/get_org_repos_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/get_self_repos_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/get_user_repos_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions man/ghapi3-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5aa165f

Please sign in to comment.