Skip to content

Commit 08749f8

Browse files
authored
Update to newest CI (#4656)
1 parent f5e01ba commit 08749f8

14 files changed

+100
-113
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
#
4+
# NOTE: This workflow is overkill for most R packages and
5+
# check-standard.yaml is likely a better choice.
6+
# usethis::use_github_action("check-standard") will install it.
17
on:
28
push:
3-
branches:
4-
- master
9+
branches: [main, master]
510
pull_request:
6-
branches:
7-
- master
11+
branches: [main, master]
812

913
name: R-CMD-check
1014

@@ -29,8 +33,8 @@ jobs:
2933
- {os: ubuntu-18.04, r: '4.0', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
3034
- {os: ubuntu-18.04, r: '3.6', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
3135
- {os: ubuntu-18.04, r: '3.5', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
32-
- {os: ubuntu-18.04, r: '3.4', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
33-
- {os: ubuntu-18.04, r: '3.3', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
36+
- {os: ubuntu-18.04, r: '3.4', vdiffr: false, xref: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
37+
- {os: ubuntu-18.04, r: '3.3', vdiffr: false, xref: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
3438

3539
env:
3640
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
@@ -74,16 +78,13 @@ jobs:
7478
do
7579
eval sudo $cmd
7680
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04"))')
77-
7881
- name: Install system dependencies on macOS
7982
if: runner.os == 'macOS'
8083
run: |
8184
# XQuartz is needed by vdiffr
8285
brew install xquartz
83-
8486
# Use only binary packages
8587
echo 'options(pkgType = "binary")' >> ~/.Rprofile
86-
8788
- name: Install dependencies
8889
run: |
8990
remotes::install_deps(dependencies = TRUE)

.github/workflows/pkgdown.yaml

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,34 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- master
5-
release:
65
types: [published]
6+
branches: [main, master]
7+
tags: ['*']
78

89
name: pkgdown
910

1011
jobs:
1112
pkgdown:
12-
runs-on: ubuntu-18.04
13+
runs-on: ubuntu-latest
1314
env:
14-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16-
1716
steps:
1817
- uses: actions/checkout@v2
1918

20-
- uses: r-lib/actions/setup-r@v1
21-
id: install-r
22-
2319
- uses: r-lib/actions/setup-pandoc@v1
2420

25-
- name: Install pak and query dependencies
26-
run: |
27-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
28-
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
29-
shell: Rscript {0}
30-
31-
- name: Restore R package cache
32-
uses: actions/cache@v2
21+
- uses: r-lib/actions/setup-r@v1
3322
with:
34-
path: |
35-
${{ env.R_LIBS_USER }}/*
36-
!${{ env.R_LIBS_USER }}/pak
37-
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
38-
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
23+
use-public-rspm: true
3924

40-
- name: Install system dependencies
41-
if: runner.os == 'Linux'
42-
run: |
43-
pak::local_system_requirements(execute = TRUE)
44-
pak::pkg_system_requirements("pkgdown", execute = TRUE)
45-
shell: Rscript {0}
46-
47-
- name: Install dependencies
48-
run: |
49-
pak::local_install_dev_deps(upgrade = TRUE, dependencies = c("all", "Config/Needs/website"))
50-
pak::pkg_install("r-lib/pkgdown")
51-
shell: Rscript {0}
52-
53-
- name: Install package
54-
run: R CMD INSTALL .
25+
- uses: r-lib/actions/setup-r-dependencies@v1
26+
with:
27+
extra-packages: pkgdown
28+
needs: website
5529

5630
- name: Deploy package
5731
run: |
58-
git config --local user.email "[email protected]"
59-
git config --local user.name "GitHub Actions"
32+
git config --local user.name "$GITHUB_ACTOR"
33+
git config --local user.email "[email protected]"
6034
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

.github/workflows/pr-commands.yaml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,75 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
issue_comment:
35
types: [created]
6+
47
name: Commands
8+
59
jobs:
610
document:
711
if: startsWith(github.event.comment.body, '/document')
812
name: document
9-
runs-on: macOS-latest
13+
runs-on: ubuntu-latest
1014
env:
1115
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1216
steps:
1317
- uses: actions/checkout@v2
18+
1419
- uses: r-lib/actions/pr-fetch@v1
1520
with:
1621
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
1723
- uses: r-lib/actions/setup-r@v1
18-
- name: Install dependencies
19-
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
24+
with:
25+
use-public-rspm: true
26+
27+
- uses: r-lib/actions/setup-r-dependencies@v1
28+
with:
29+
extra-packages: roxygen2
30+
2031
- name: Document
2132
run: Rscript -e 'roxygen2::roxygenise()'
33+
2234
- name: commit
2335
run: |
24-
git config --local user.email "[email protected]"
25-
git config --local user.name "GitHub Actions"
36+
git config --local user.name "$GITHUB_ACTOR"
37+
git config --local user.email "[email protected]"
2638
git add man/\* NAMESPACE
2739
git commit -m 'Document'
40+
2841
- uses: r-lib/actions/pr-push@v1
2942
with:
3043
repo-token: ${{ secrets.GITHUB_TOKEN }}
44+
3145
style:
3246
if: startsWith(github.event.comment.body, '/style')
3347
name: style
34-
runs-on: macOS-latest
48+
runs-on: ubuntu-latest
3549
env:
3650
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3751
steps:
3852
- uses: actions/checkout@v2
53+
3954
- uses: r-lib/actions/pr-fetch@v1
4055
with:
4156
repo-token: ${{ secrets.GITHUB_TOKEN }}
57+
4258
- uses: r-lib/actions/setup-r@v1
59+
4360
- name: Install dependencies
4461
run: Rscript -e 'install.packages("styler")'
62+
4563
- name: Style
4664
run: Rscript -e 'styler::style_pkg()'
65+
4766
- name: commit
4867
run: |
49-
git config --local user.email "[email protected]"
50-
git config --local user.name "GitHub Actions"
68+
git config --local user.name "$GITHUB_ACTOR"
69+
git config --local user.email "[email protected]"
5170
git add \*.R
5271
git commit -m 'Style'
72+
5373
- uses: r-lib/actions/pr-push@v1
5474
with:
5575
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,29 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- master
5+
branches: [main, master]
56
pull_request:
6-
branches:
7-
- master
7+
branches: [main, master]
88

99
name: test-coverage
1010

11-
# Increment this version when we want to clear cache
12-
env:
13-
cache-version: v1
14-
1511
jobs:
1612
test-coverage:
17-
runs-on: ubuntu-18.04
13+
runs-on: ubuntu-latest
1814
env:
19-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
2015
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2116

2217
steps:
2318
- uses: actions/checkout@v2
2419

2520
- uses: r-lib/actions/setup-r@v1
26-
id: install-r
27-
28-
- name: Install pak and query dependencies
29-
run: |
30-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
31-
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
32-
shell: Rscript {0}
33-
34-
- name: Restore R package cache
35-
uses: actions/cache@v2
3621
with:
37-
path: |
38-
${{ env.R_LIBS_USER }}/*
39-
!${{ env.R_LIBS_USER }}/pak
40-
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-${{ env.cache-version }}-${{ hashFiles('.github/r-depends.rds') }}
41-
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-${{ env.cache-version }}-
22+
use-public-rspm: true
4223

43-
- name: Install system dependencies
44-
if: runner.os == 'Linux'
45-
run: |
46-
pak::local_system_requirements(execute = TRUE)
47-
pak::pkg_system_requirements("covr", execute = TRUE)
48-
shell: Rscript {0}
49-
50-
- name: Install dependencies
51-
run: |
52-
pak::local_install_dev_deps(upgrade = TRUE)
53-
pak::pkg_install("covr")
54-
shell: Rscript {0}
24+
- uses: r-lib/actions/setup-r-dependencies@v1
25+
with:
26+
extra-packages: covr
5527

5628
- name: Test coverage
5729
run: covr::codecov()

R/geom-segment.r

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@
3838
#' arrow = arrow(length = unit(0.03, "npc"))
3939
#' )
4040
#'
41+
#' if (requireNamespace('maps', quietly = TRUE)) {
4142
#' ggplot(seals, aes(long, lat)) +
4243
#' geom_segment(aes(xend = long + delta_long, yend = lat + delta_lat),
4344
#' arrow = arrow(length = unit(0.1,"cm"))) +
4445
#' borders("state")
46+
#' }
4547
#'
4648
#' # Use lineend and linejoin to change the style of the segments
4749
#' df2 <- expand.grid(

R/geom-sf.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,15 @@
8888
#' annotate("point", x = -80, y = 35, colour = "red", size = 4) +
8989
#' coord_sf(default_crs = sf::st_crs(4326))
9090
#'
91+
#' # To add labels, use geom_sf_label().
92+
#' ggplot(nc_3857[1:3, ]) +
93+
#' geom_sf(aes(fill = AREA)) +
94+
#' geom_sf_label(aes(label = NAME))
95+
#' }
96+
#'
9197
#' # Thanks to the power of sf, a geom_sf nicely handles varying projections
9298
#' # setting the aspect ratio correctly.
99+
#' if (requireNamespace('maps', quietly = TRUE)) {
93100
#' library(maps)
94101
#' world1 <- sf::st_as_sf(map('world', plot = FALSE, fill = TRUE))
95102
#' ggplot() + geom_sf(data = world1)
@@ -99,11 +106,6 @@
99106
#' "+proj=laea +y_0=0 +lon_0=155 +lat_0=-90 +ellps=WGS84 +no_defs"
100107
#' )
101108
#' ggplot() + geom_sf(data = world2)
102-
#'
103-
#' # To add labels, use geom_sf_label().
104-
#' ggplot(nc_3857[1:3, ]) +
105-
#' geom_sf(aes(fill = AREA)) +
106-
#' geom_sf_label(aes(label = NAME))
107109
#' }
108110
#' @name ggsf
109111
NULL

README.Rmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ knitr::opts_chunk$set(
1414

1515
# ggplot2 <img src="man/figures/logo.png" align="right" width="120" />
1616

17-
[![R build status](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
18-
[![Coverage Status](https://img.shields.io/codecov/c/github/tidyverse/ggplot2/master.svg)](https://codecov.io/github/tidyverse/ggplot2?branch=master)
17+
<!-- badges: start -->
18+
[![R-CMD-check](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
19+
[![Codecov test coverage](https://codecov.io/gh/tidyverse/ggplot2/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2?branch=main)
1920
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
21+
<!-- badges: end -->
2022

2123
## Overview
2224

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
# ggplot2 <img src="man/figures/logo.png" align="right" width="120" />
55

6-
[![R build
7-
status](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
8-
[![Coverage
9-
Status](https://img.shields.io/codecov/c/github/tidyverse/ggplot2/master.svg)](https://codecov.io/github/tidyverse/ggplot2?branch=master)
10-
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
6+
<!-- badges: start -->
7+
8+
[![R-CMD-check](https://github.com/tidyverse/ggplot2/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/ggplot2/actions)
9+
[![Codecov test
10+
coverage](https://codecov.io/gh/tidyverse/ggplot2/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/ggplot2?branch=main)
11+
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/ggplot2)](https://cran.r-project.org/package=ggplot2)
12+
<!-- badges: end -->
1113

1214
## Overview
1315

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ coverage:
66
default:
77
target: auto
88
threshold: 1%
9+
informational: true
910
patch:
1011
default:
1112
target: auto
1213
threshold: 1%
14+
informational: true

man/geom_segment.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ggsf.Rd

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)