Skip to content

Commit ca5a4c9

Browse files
committed
wip migrate to gha
1 parent 9ca8892 commit ca5a4c9

14 files changed

+266
-193
lines changed

Diff for: .Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ revdep/
2020
README.Rmd
2121
abbvie.R
2222
^\.httr-oauth$
23+
^\.github$

Diff for: .github/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

Diff for: .github/workflows/R-CMD-check.yaml

+141
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# NOTE: This workflow is overkill for most R packages
2+
# check-standard.yaml is likely a better choice
3+
# usethis::use_github_action("check-standard") will install it.
4+
#
5+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
6+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
7+
on:
8+
push:
9+
branches:
10+
- main
11+
- master
12+
pull_request:
13+
branches:
14+
- main
15+
- master
16+
17+
name: R-CMD-check
18+
19+
jobs:
20+
R-CMD-check:
21+
runs-on: ${{ matrix.config.os }}
22+
23+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
config:
29+
- {os: macOS-latest, r: 'release'}
30+
- {os: windows-latest, r: 'release'}
31+
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
32+
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.1.0 (ubuntu-18.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
33+
# vdiffr & shinytest only runs on linux r-release since the results aren't cross-platform
34+
- {os: ubuntu-18.04, r: 'release', vdiffr: true, shinytest: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
35+
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
36+
- {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
37+
- {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
38+
- {os: ubuntu-18.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
39+
40+
env:
41+
RSPM: ${{ matrix.config.rspm }}
42+
VDIFFR: ${{ matrix.config.vdiffr }}
43+
SHINYTEST: ${{ matrix.config.shinytest }}
44+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
45+
46+
steps:
47+
- uses: actions/checkout@v2
48+
49+
- uses: r-lib/actions/setup-r@v1
50+
id: install-r
51+
with:
52+
r-version: ${{ matrix.config.r }}
53+
http-user-agent: ${{ matrix.config.http-user-agent }}
54+
55+
- uses: r-lib/actions/setup-pandoc@v1
56+
57+
- name: Install pak and query dependencies
58+
run: |
59+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
60+
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
61+
shell: Rscript {0}
62+
63+
- name: Restore R package cache
64+
uses: actions/cache@v2
65+
with:
66+
path: |
67+
${{ env.R_LIBS_USER }}/*
68+
!${{ env.R_LIBS_USER }}/pak
69+
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
70+
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
71+
72+
- name: Install system dependencies
73+
if: runner.os == 'Linux'
74+
run: |
75+
pak::local_system_requirements(execute = TRUE)
76+
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
77+
shell: Rscript {0}
78+
79+
#- name: Install google chrome
80+
# if: matrix.config.vdiffr == true
81+
# shell: bash
82+
# run: |
83+
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
84+
# sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
85+
# apt-get update -y
86+
# apt-get install -y google-chrome-stable
87+
88+
# TODO: maybe this should install via conda or npm instead?
89+
- name: Install orca
90+
if: matrix.config.vdiffr == true
91+
shell: bash
92+
run: |
93+
sudo apt-get -y update
94+
sudo apt-get install -y libgtk2.0-0 libgconf-2-4 xvfb xauth libxtst6 libxss1 libnss3 libasound2 desktop-file-utils
95+
mkdir -p /opt/orca
96+
cd /opt/orca
97+
wget https://github.com/plotly/orca/releases/download/v1.3.1/orca-1.3.1.AppImage
98+
sudo chmod +x orca-1.3.1.AppImage
99+
sudo ./orca-1.3.1.AppImage --appimage-extract
100+
sudo rm orca-1.3.1.AppImage
101+
sudo printf '#!/bin/bash \nargs=("$@") \nif [[ ! " ${args[@]} " =~ "--no-sandbox" ]]; then \n args+=("--no-sandbox") \nfi \nxvfb-run --auto-servernum --server-args "-screen 0 640x480x24" /opt/orca/squashfs-root/orca "${args[@]}"' > /usr/bin/orca \
102+
sudo chmod +x /usr/bin/orca
103+
sudo orca graph '{ "data": [{"y": [1,2,1]}] }' -o fig.png
104+
105+
- name: Install dependencies
106+
run: |
107+
pak::local_install_dev_deps(upgrade = TRUE)
108+
pak::pkg_install("rcmdcheck")
109+
shell: Rscript {0}
110+
111+
- name: Session info
112+
run: |
113+
options(width = 100)
114+
pkgs <- installed.packages()[, "Package"]
115+
sessioninfo::session_info(pkgs, include_base = TRUE)
116+
shell: Rscript {0}
117+
118+
- name: Check
119+
env:
120+
_R_CHECK_CRAN_INCOMING_: false
121+
run: |
122+
options(crayon.enabled = TRUE)
123+
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
124+
shell: Rscript {0}
125+
126+
- name: Show testthat output
127+
if: always()
128+
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
129+
shell: bash
130+
131+
- name: Upload check results
132+
if: failure()
133+
uses: actions/upload-artifact@main
134+
with:
135+
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
136+
path: check
137+
138+
- name: Don't use tar from old Rtools to store the cache
139+
if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }}
140+
shell: bash
141+
run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH

Diff for: .travis.yml

-36
This file was deleted.

Diff for: DESCRIPTION

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ Suggests:
7474
processx,
7575
plotlyGeoAssets,
7676
forcats,
77-
palmerpenguins
77+
palmerpenguins,
78+
rversions
7879
LazyData: true
7980
RoxygenNote: 7.1.1
8081
Encoding: UTF-8

Diff for: NEWS.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 4.9.4.9000
2+
3+
## Changes to plotly.js
4+
5+
* This version of the R package upgrades the version of the underlying plotly.js library from v1.57.1 to v2.0.0. This includes many breaking changes, bug fixes, and improvements to the underlying JavaScript library. The [plotly.js release page](https://github.com/plotly/plotly.js/releases) has the full list of changes.
6+
7+
## Breaking changes
8+
9+
* `ggplotly()` now uses the `layout.legend.title` (instead of `layout.annotations`) plotly.js API to convert guides for discrete scales. (#1961)
10+
111
# 4.9.4.1
212

313
## BUG FIXES

Diff for: README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33

44
<img src="man/figures/plotly.png" width="200" />
55

6-
[![Build
7-
Status](https://travis-ci.org/ropensci/plotly.png?branch=master)](https://travis-ci.org/ropensci/plotly)
6+
<!-- badges: start -->
7+
[![R-CMD-check](https://github.com/ropensci/plotly/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/plotly/actions)
88
[![CRAN
99
Status](https://www.r-pkg.org/badges/version/plotly)](https://cran.r-project.org/package=plotly)
1010
[![CRAN
1111
Downloads](https://cranlogs.r-pkg.org/badges/grand-total/plotly)](https://www.rpackages.io/package/plotly)
1212
[![monthly](https://cranlogs.r-pkg.org/badges/plotly)](https://www.rpackages.io/package/plotly)
13+
<!-- badges: end -->
1314

1415
An R package for creating interactive web graphics via the open source
1516
JavaScript graphing library
@@ -23,10 +24,10 @@ Install from CRAN:
2324
install.packages("plotly")
2425
```
2526

26-
Or install the latest development version (on GitHub) via devtools:
27+
Or install the latest development version (on GitHub) via `{remotes}`:
2728

2829
``` r
29-
devtools::install_github("ropensci/plotly")
30+
remotes::install_github("ropensci/plotly")
3031
```
3132

3233
## Getting started

Diff for: inst/docker/Dockerfile.vtest

-95
This file was deleted.

Diff for: inst/docker/README.md

Whitespace-only changes.

Diff for: tests/testthat/helper-skip.R

+22-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
# Some tests make plot.ly HTTP requests and require a valid user account
2-
# (see test-plotly-filename.R). For security reasons, these tests should be
3-
# skipped on pull requests (the .travis.yml file uses encrypted credentials
4-
# & encrypted environment vars cannot be accessed on pull request builds)
5-
skip_if_not_master <- function() {
1+
r_version <- paste(R.version$major, R.version$minor, sep = ".")
2+
r_release <- rversions::r_release()$version
3+
is_release <- isTRUE(r_release == r_version)
4+
is_win <- .Platform$OS.type == "windows"
5+
6+
skip_cloud_tests <- function() {
7+
skip_on_cran()
68
if (is.na(Sys.getenv("plotly_username", NA))) {
7-
return(skip("Testing plot.ly API calls requires a plotly account"))
9+
skip("Cloud testing requires a plotly account (plotly_username)")
10+
}
11+
if (is.na(Sys.getenv("plotly_api_key", NA))) {
12+
skip("Cloud testing requires a plotly account (plotly_api_key)")
13+
}
14+
if (!is_release || !is_win) {
15+
skip("Cloud testing is only run on Windows with the current release of R")
16+
}
17+
}
18+
19+
skip_shinytest_tests <- function() {
20+
skip_on_cran()
21+
skip_if_not_installed("shinytest")
22+
if (!grepl("true", Sys.getenv("SHINYTEST"), fixed = TRUE)) {
23+
skip("shinytest testing requires the SHINYTEST environment variable to be true")
824
}
9-
is_pr <- grepl("^[0-9]+$", Sys.getenv("TRAVIS_PULL_REQUEST"))
10-
is_r_release <- Sys.getenv("TRAVIS_R_VERSION_STRING", "release") == "release"
11-
if (!is_pr && is_r_release) return(invisible(TRUE))
12-
skip("plot.ly API calls are only tested on the master build on r-release")
1325
}

Diff for: tests/testthat/helper-vdiffr.R

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# If VDIFFR is TRUE, enable visual testing
2-
enable_vdiffr <- as.logical(Sys.getenv("VDIFFR", FALSE))
2+
enable_vdiffr <- grepl("true", Sys.getenv("VDIFFR"), fixed = TRUE)
33

44
message("Visual testing is ", if (!enable_vdiffr) "not ", "enabled.")
55

@@ -46,9 +46,6 @@ if (enable_vdiffr) {
4646
writeLines(svg_txt, file)
4747
}
4848

49-
# force the vdiffr shiny app to open in a real browser
50-
# (some svg files seem to not render properly in RStudio)
51-
options(shiny.launch.browser = interactive())
5249
}
5350

5451
expect_doppelganger <- function(p, name, ...) {

0 commit comments

Comments
 (0)