Update to newest CI (#4656)

This commit is contained in:
Thomas Lin Pedersen 2021-11-01 19:16:27 +01:00 committed by GitHub
parent f5e01baec8
commit 08749f8b08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 100 additions and 113 deletions

View File

@ -1,10 +1,14 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master
branches: [main, master]
name: R-CMD-check
@ -29,8 +33,8 @@ jobs:
- {os: ubuntu-18.04, r: '4.0', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.6', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.5', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.4', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.3', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.4', vdiffr: false, xref: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.3', vdiffr: false, xref: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
@ -74,16 +78,13 @@ jobs:
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04"))')
- name: Install system dependencies on macOS
if: runner.os == 'macOS'
run: |
# XQuartz is needed by vdiffr
brew install xquartz
# Use only binary packages
echo 'options(pkgType = "binary")' >> ~/.Rprofile
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)

View File

@ -1,60 +1,34 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
release:
types: [published]
branches: [main, master]
tags: ['*']
name: pkgdown
jobs:
pkgdown:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
id: install-r
- uses: r-lib/actions/setup-pandoc@v1
- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@v1
with:
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
use-public-rspm: true
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("pkgdown", execute = TRUE)
shell: Rscript {0}
- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE, dependencies = c("all", "Config/Needs/website"))
pak::pkg_install("r-lib/pkgdown")
shell: Rscript {0}
- name: Install package
run: R CMD INSTALL .
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: pkgdown
needs: website
- name: Deploy package
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

View File

@ -1,55 +1,75 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
issue_comment:
types: [created]
name: Commands
jobs:
document:
if: startsWith(github.event.comment.body, '/document')
name: document
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v1
- name: Install dependencies
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: roxygen2
- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
- name: commit
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
style:
if: startsWith(github.event.comment.body, '/style')
name: style
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v1
- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
- name: Style
run: Rscript -e 'styler::style_pkg()'
- name: commit
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,57 +1,29 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master
branches: [main, master]
name: test-coverage
# Increment this version when we want to clear cache
env:
cache-version: v1
jobs:
test-coverage:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
id: install-r
- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v2
with:
path: |
${{ env.R_LIBS_USER }}/*
!${{ env.R_LIBS_USER }}/pak
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-${{ env.cache-version }}-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-${{ env.cache-version }}-
use-public-rspm: true
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
pak::local_system_requirements(execute = TRUE)
pak::pkg_system_requirements("covr", execute = TRUE)
shell: Rscript {0}
- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::pkg_install("covr")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: covr
- name: Test coverage
run: covr::codecov()

View File

@ -38,10 +38,12 @@
#' arrow = arrow(length = unit(0.03, "npc"))
#' )
#'
#' if (requireNamespace('maps', quietly = TRUE)) {
#' ggplot(seals, aes(long, lat)) +
#' geom_segment(aes(xend = long + delta_long, yend = lat + delta_lat),
#' arrow = arrow(length = unit(0.1,"cm"))) +
#' borders("state")
#' }
#'
#' # Use lineend and linejoin to change the style of the segments
#' df2 <- expand.grid(

View File

@ -88,8 +88,15 @@
#' annotate("point", x = -80, y = 35, colour = "red", size = 4) +
#' coord_sf(default_crs = sf::st_crs(4326))
#'
#' # To add labels, use geom_sf_label().
#' ggplot(nc_3857[1:3, ]) +
#' geom_sf(aes(fill = AREA)) +
#' geom_sf_label(aes(label = NAME))
#' }
#'
#' # Thanks to the power of sf, a geom_sf nicely handles varying projections
#' # setting the aspect ratio correctly.
#' if (requireNamespace('maps', quietly = TRUE)) {
#' library(maps)
#' world1 <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE))
#' ggplot() + geom_sf(data = world1)
@ -99,11 +106,6 @@
#' "+proj=laea +y_0=0 +lon_0=155 +lat_0=-90 +ellps=WGS84 +no_defs"
#' )
#' ggplot() + geom_sf(data = world2)
#'
#' # To add labels, use geom_sf_label().
#' ggplot(nc_3857[1:3, ]) +
#' geom_sf(aes(fill = AREA)) +
#' geom_sf_label(aes(label = NAME))
#' }
#' @name ggsf
NULL

View File

@ -14,9 +14,11 @@ knitr::opts_chunk$set(
# ggplot2 <img src="man/figures/logo.png" align="right" width="120" />
[![R build status](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/tidyverse/ggplot2/master.svg)](https://codecov.io/github/tidyverse/ggplot2?branch=master)
<!-- badges: start -->
[![R-CMD-check](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
[![Codecov test coverage](https://codecov.io/gh/tidyverse/ggplot2/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2?branch=main)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
<!-- badges: end -->
## Overview

View File

@ -3,11 +3,13 @@
# ggplot2 <img src="man/figures/logo.png" align="right" width="120" />
[![R build
status](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
[![Coverage
Status](https://img.shields.io/codecov/c/github/tidyverse/ggplot2/master.svg)](https://codecov.io/github/tidyverse/ggplot2?branch=master)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
<!-- badges: start -->
[![R-CMD-check](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
[![Codecov test
coverage](https://codecov.io/gh/tidyverse/ggplot2/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2?branch=main)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
<!-- badges: end -->
## Overview

View File

@ -6,7 +6,9 @@ coverage:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true

View File

@ -149,10 +149,12 @@ b + geom_curve(
arrow = arrow(length = unit(0.03, "npc"))
)
if (requireNamespace('maps', quietly = TRUE)) {
ggplot(seals, aes(long, lat)) +
geom_segment(aes(xend = long + delta_long, yend = lat + delta_lat),
arrow = arrow(length = unit(0.1,"cm"))) +
borders("state")
}
# Use lineend and linejoin to change the style of the segments
df2 <- expand.grid(

View File

@ -341,8 +341,15 @@ ggplot(nc_3857) +
annotate("point", x = -80, y = 35, colour = "red", size = 4) +
coord_sf(default_crs = sf::st_crs(4326))
# To add labels, use geom_sf_label().
ggplot(nc_3857[1:3, ]) +
geom_sf(aes(fill = AREA)) +
geom_sf_label(aes(label = NAME))
}
# Thanks to the power of sf, a geom_sf nicely handles varying projections
# setting the aspect ratio correctly.
if (requireNamespace('maps', quietly = TRUE)) {
library(maps)
world1 <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE))
ggplot() + geom_sf(data = world1)
@ -352,11 +359,6 @@ world2 <- sf::st_transform(
"+proj=laea +y_0=0 +lon_0=155 +lat_0=-90 +ellps=WGS84 +no_defs"
)
ggplot() + geom_sf(data = world2)
# To add labels, use geom_sf_label().
ggplot(nc_3857[1:3, ]) +
geom_sf(aes(fill = AREA)) +
geom_sf_label(aes(label = NAME))
}
}
\seealso{

View File

@ -31,6 +31,7 @@ test_that("segment annotations transform with scales", {
})
test_that("annotation_* has dummy data assigned and don't inherit aes", {
skip_if(packageVersion("base") < "3.5.0")
custom <- annotation_custom(zeroGrob())
logtick <- annotation_logticks()
library(maps)

View File

@ -1,9 +1,9 @@
context("coord_map")
us_map <- map_data("usa")
p_us <- ggplot(us_map, aes(x = long, y = lat, group = group))
test_that("USA state map drawn", {
skip_if(packageVersion("base") < "3.5.0")
us_map <- map_data("usa")
p_us <- ggplot(us_map, aes(x = long, y = lat, group = group))
expect_doppelganger(
"USA mercator",
p_us +
@ -13,6 +13,9 @@ test_that("USA state map drawn", {
})
test_that("coord_map scale position can be switched", {
skip_if(packageVersion("base") < "3.5.0")
us_map <- map_data("usa")
p_us <- ggplot(us_map, aes(x = long, y = lat, group = group))
expect_doppelganger(
"coord_map switched scale position",
p_us +
@ -24,6 +27,7 @@ test_that("coord_map scale position can be switched", {
})
test_that("Inf is squished to range", {
skip_if(packageVersion("base") < "3.5.0")
d <- cdata(
ggplot(data_frame(x = 0, y = 0)) +
geom_point(aes(x,y)) +

View File

@ -29,6 +29,7 @@ test_that("check h/v/abline transformed on basic projections", {
})
test_that("curved lines in map projections", {
skip_if(packageVersion("base") < "3.5.0")
nz <- subset(map_data("nz"), region == "North.Island ")
nzmap <- ggplot(nz, aes(long, lat, group = group)) +
geom_path() +