Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert to a flat r package layout #17

Merged
merged 26 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
^.*\.Rproj$
^.*\..Rcheck$
^\.Rproj\.user$

^doc$
^shiny$
^docs$
^Meta$
^js$
^scripts$
^types$
^\.github$
^\.vscode$
^binder$
^node_modules$
^\.yarn$

^.*\.map$
^.*\.js$
^.*\.json$
^.*\.cjs$
^\.lintr$
^yarn\.lock$
^bench\.R$
^\.yarnrc\.yml$

^_pkgdown\.yml$
^pkgdown$
^data-raw$
^cran-comments.md$
^.editorconfig$
102 changes: 41 additions & 61 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,78 @@ on: [push]

jobs:
build_r:
runs-on: ubuntu-16.04
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: https://demo.rstudiopm.com/all/__linux__/xenial/latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
with:
r-version: 3.6
- uses: r-lib/actions/setup-pandoc@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: 14
# build client code
- run: npm i -g yarn
- run: yarn set version berry
- run: yarn config set checksumBehavior ignore
- name: Cache Node.js modules
uses: actions/cache@v1
uses: actions/cache@v2.1.6
with:
path: ./.yarn
key: ${{ runner.os }}-yarn2-${{ hashFiles('**/yarn.lock') }}
path: |
./.yarn/cache
./.yarn/unplugged
key: ${{ runner.os }}-yarn2-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn2-
${{ runner.os }}-yarn2-v4
- run: yarn install
env:
CI: true
- run: yarn build
env:
CI: true

- name: Cache R packages
uses: actions/cache@v1
- run: yarn clean:r
- uses: r-lib/actions/setup-r@v1
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-v2-${{ hashFiles('r_package/DESCRIPTION')}}
restore-keys: ${{ runner.os }}-r-v2-
extra-packages: |
webshot
textshaping
devtools

# - name: Install system dependencies
# env:
# RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
# run: |
# Rscript -e "remotes::install_github('r-hub/sysreqs')"
# sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
# sudo -s eval "$sysreqs"
- name: Style / Format
shell: Rscript {0}
run: styler::style_pkg( dry="fail")

- name: Install dependencies
run: |
install.packages(c('devtools', 'pkgdown', 'webshot', 'textshaping'))
devtools::install_deps('r_package', dependencies = TRUE)
- name: Lint
shell: Rscript {0}
run: |
devtools::load_all()
lintr::lint_package()

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: devtools::check('r_package', args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
shell: Rscript {0}
run: devtools::check( args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")

- name: Test
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: devtools::test('r_package')
shell: Rscript {0}
run: devtools::test()

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

- name: Build Package
run: yarn build:r
- name: Prepare Docs
run: |
mkdir -p public/integrations/r
cp ./upsetjs.tar.gz public/integrations/r/
cp README.md r_package/
- name: Build Website
run: yarn docs:r
- name: Copy Docs
run: |
mv r_package/docs/* public/integrations/r/
mv docs/* public/integrations/r/

- name: Deploy Master
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
- name: Deploy Main
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: upsetjs/actions-gh-pages@sgratzl
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
Expand Down Expand Up @@ -125,28 +111,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: '12.x'
node-version: 14
# build client code
- run: npm i -g yarn
- run: yarn set version berry
- run: yarn config set checksumBehavior ignore
- name: Cache Node.js modules
uses: actions/cache@v1
uses: actions/cache@v2.1.6
with:
path: ./.yarn
key: ${{ runner.os }}-yarn2-${{ hashFiles('**/yarn.lock') }}
path: |
./.yarn/cache
./.yarn/unplugged
key: ${{ runner.os }}-yarn2-v4-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn2-
${{ runner.os }}-yarn2-v4
- run: yarn install
env:
CI: true
- run: yarn build
env:
CI: true
- run: yarn lint
env:
CI: true
# - run: yarn test --ci --coverage --maxWorkers=2
# env:
# CI: true
20 changes: 17 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,26 @@ examples/*.html
doc
Meta
node_modules
.yarn
.yarnrc.yml
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/versions
.pnp.*
.vscode
*.log
*.map
docs
/*.tar.gz
*.Rcheck
.pnp.js
.pnp.*
/man
/doc
/docs
/NAMESPACE
/inst/htmlwidgets/upsetjs.js
/inst/htmlwidgets/upsetjs.js.LICENSE.txt
doc
Meta
/vignettes/*.R
/vignettes/*.html
6 changes: 6 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
linters: with_defaults(
line_length_linter(200),
object_name_linter = NULL,
cyclocomp_linter = NULL,
commented_code_linter = NULL
)
631 changes: 631 additions & 0 deletions .yarn/releases/yarn-3.0.2.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-3.0.2.cjs
18 changes: 11 additions & 7 deletions r_package/DESCRIPTION → DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ Imports:
htmlwidgets,
magrittr
Suggests:
knitr,
crosstalk,
rmarkdown,
formatR,
tibble,
testthat
knitr,
crosstalk,
rmarkdown,
formatR,
tibble,
testthat,
styler,
lintr,
pkgdown
LazyData: true
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
Language: en-US
KeepSource: true
Loading