1
- # Action script of tests conducted for all platforms. The complete suite
2
- # of tests is described in .github/workflows/R-CMD-check-with-db.yaml
3
-
1
+ # For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2
+ # https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
4
3
on :
5
4
push :
6
5
pull_request :
7
- branches :
8
- - master
9
6
10
7
name : R-CMD-check
11
8
@@ -19,100 +16,64 @@ jobs:
19
16
fail-fast : false
20
17
matrix :
21
18
config :
22
- # - {os: windows-latest, r: '3.6'}
23
- - {os: macOS-latest, r: '3.6', args: '--install-args=\"--configure-args=--with-proj-lib=/usr/local/lib/\"", "--ignore-vignettes', build_args: "--no-build-vignettes"}
24
- - {os: macOS-latest, r: 'devel', args: '--install-args=\"--configure-args=--with-proj-lib=/usr/local/lib/\"", "--ignore-vignettes', build_args: "--no-build-vignettes"}
25
- - {os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
26
- - {os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
27
- # - {os: ubuntu-latest, r: 'release'}
19
+ - {os: windows-latest, r: 'release'}
20
+ - {os: macOS-latest, r: 'release'}
21
+ - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
22
+ - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
28
23
29
24
env :
30
25
R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
31
- CRAN : ${{ matrix.config.cran }}
26
+ RSPM : ${{ matrix.config.rspm }}
27
+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
32
28
33
29
steps :
34
- - uses : actions/checkout@v1
30
+ - uses : actions/checkout@v2
35
31
36
- - uses : r-lib/actions/setup-r@master
32
+ - uses : r-lib/actions/setup-r@v1
37
33
with :
38
34
r-version : ${{ matrix.config.r }}
39
35
40
- - uses : r-lib/actions/setup-pandoc@master
41
-
42
- - name : Brew and macOS config
43
- if : runner.os == 'macOS'
44
- run : |
45
- brew install pkg-config
46
- brew install udunits
47
- brew install gdal
48
- cat <<EOT >> .Renviron
49
- PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
50
- PROJ_LIB=/usr/local/opt/proj/share/proj/
51
- # for installing XML package from source
52
- XML_CONFIG=/usr/local/opt/libxml2/bin/xml2-config
53
- EOT
54
- cat <<EOT >> .Rprofile
55
- config_args <- c("lwgeom" = "--with-proj-lib=/usr/local/lib/", "rgdal" = "--with-proj-lib=/usr/local/lib/ --with-proj-include=/usr/local/include/")
56
- r <- getOption("repos")
57
- r["CRAN"] <- "https://cran.rstudio.com"
58
- options(configure.args = config_args, repos = r)
59
- EOT
60
-
61
36
- name : Query dependencies
62
37
run : |
63
38
install.packages('remotes')
64
- saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
39
+ saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
40
+ writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
65
41
shell : Rscript {0}
66
42
67
- - name : Cache R packages
68
- if : runner.os != 'Windows'
69
- uses : actions/cache@v1
43
+ - name : Restore R package cache
44
+ uses : actions/cache@v2
70
45
with :
71
46
path : ${{ env.R_LIBS_USER }}
72
- key : ${{ runner.os }}-r- ${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
73
- restore-keys : ${{ runner.os }}-r- ${{ matrix.config.r }}-
47
+ key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- ${{ hashFiles('.github/ depends.Rds') }}
48
+ restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1 -
74
49
75
- - name : Install system dependencies
50
+ - name : Install system dependencies (Linux)
76
51
if : runner.os == 'Linux'
77
- env :
78
- RHUB_PLATFORM : linux-x86_64-ubuntu-gcc
79
52
run : |
80
- Rscript -e "remotes::install_github('r-hub/sysreqs')"
81
- sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
82
- sudo -s eval "$sysreqs"
83
-
84
- # install spatial dependencies
85
- sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
86
- sudo apt update
87
- sudo apt install \
88
- libudunits2-dev \
89
- libgdal-dev \
90
- libgeos-dev \
91
- libproj-dev
92
-
53
+ sudo apt-get update
54
+ sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev
55
+
56
+ - name : Install system dependencies (MacOS)
57
+ if : runner.os == 'MacOS'
58
+ run : brew install gdal proj udunits pkg-config
93
59
94
60
- name : Install dependencies
95
61
run : |
96
- library(remotes)
97
- deps <- readRDS("depends.Rds")
98
- deps[["installed"]] <- vapply(deps[["package"]], remotes:::local_sha, character(1))
99
- update(deps)
62
+ remotes::install_deps(dependencies = TRUE)
100
63
remotes::install_cran("rcmdcheck")
101
64
shell : Rscript {0}
102
65
103
- - name : Install rgdal with configure
104
- if : runner.os == 'macOS'
105
- run : |
106
- install.packages("rgdal", type = "source", configure.args = "--with-proj-lib=/usr/local/lib/ --with-proj-include=/usr/local/include/")
107
- shell : Rscript {0}
108
-
109
66
- name : Check
110
- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "${{ matrix.config.args }}"), error_on = "warning", check_dir = "check", build_args = "${{ matrix.config.build_args }}")
67
+ env :
68
+ _R_CHECK_CRAN_INCOMING_REMOTE_ : false
69
+ run : |
70
+ options(crayon.enabled = TRUE)
71
+ rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
111
72
shell : Rscript {0}
112
73
113
74
- name : Upload check results
114
75
if : failure()
115
- uses : actions/upload-artifact@master
76
+ uses : actions/upload-artifact@main
116
77
with :
117
78
name : ${{ runner.os }}-r${{ matrix.config.r }}-results
118
79
path : check
0 commit comments