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.
1
+ # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2
+ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
4
3
#
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
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.
7
7
on :
8
8
push :
9
- branches :
10
- - main
11
- - master
9
+ branches : [main, master]
12
10
pull_request :
13
- branches :
14
- - main
15
- - master
11
+ branches : [main, master]
16
12
17
13
name : R-CMD-check
18
14
@@ -27,92 +23,74 @@ jobs:
27
23
matrix :
28
24
config :
29
25
- {os: macOS-latest, r: 'release'}
26
+
30
27
- {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
- - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", custom: 'no-cpp11test'}
34
- - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", custom: 'gcc 4.8'}
35
- - {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
36
- - {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
37
- - {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
38
- - {os: ubuntu-18.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
39
- - {os: ubuntu-18.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
28
+ # Use 3.6 to trigger usage of RTools35
29
+ - {os: windows-latest, r: '3.6'}
30
+
31
+ # Use older ubuntu to maximise backward compatibility
32
+ - {os: ubuntu-20.04, r: 'devel', http-user-agent: 'release'}
33
+ - {os: ubuntu-20.04, r: 'release'}
34
+ - {os: ubuntu-20.04, r: 'release', custom: 'no-cpp11test'}
35
+ - {os: ubuntu-20.04, r: 'release', custom: 'gcc 4.8'}
36
+ - {os: ubuntu-20.04, r: 'oldrel-1'}
37
+ - {os: ubuntu-20.04, r: 'oldrel-2'}
38
+ - {os: ubuntu-20.04, r: 'oldrel-3'}
39
+ - {os: ubuntu-20.04, r: 'oldrel-4'}
40
40
41
41
env :
42
- RSPM : ${{ matrix.config.rspm }}
43
42
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
43
+ R_KEEP_PKG_SOURCE : yes
44
44
45
45
steps :
46
46
- uses : actions/checkout@v2
47
47
48
- - uses : r-lib/actions/setup-r@v1
49
- id : install-r
48
+ - uses : r-lib/actions/setup-pandoc@v2
49
+
50
+ - uses : r-lib/actions/setup-r@v2
50
51
with :
51
52
r-version : ${{ matrix.config.r }}
52
53
http-user-agent : ${{ matrix.config.http-user-agent }}
53
-
54
- - uses : r-lib/actions/setup-pandoc@v1
55
-
56
- - name : Install pak and query dependencies
57
- run : |
58
- install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
59
- saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
60
- shell : Rscript {0}
61
-
62
- - name : Restore R package cache
63
- uses : actions/cache@v2
64
- with :
65
- path : |
66
- ${{ env.R_LIBS_USER }}/*
67
- !${{ env.R_LIBS_USER }}/pak
68
- key : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
69
- restore-keys : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
70
-
71
- - name : Install system dependencies
72
- if : runner.os == 'Linux'
73
- run : |
74
- pak::local_system_requirements(execute = TRUE)
75
- pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
76
- shell : Rscript {0}
54
+ use-public-rspm : true
77
55
78
56
- name : Install compiler version
57
+ # We check on this old compiler specifically to support CentOS 7,
58
+ # which uses this gcc version. RStudio products support CentOS 7 through
59
+ # June 2024.
60
+ # https://github.com/r-lib/cpp11/pull/78
61
+ # https://www.rstudio.com/about/platform-support/
62
+ # Ubuntu 20.04 technically dropped support for gcc 4.8, so we have to
63
+ # add old archives back in manually to install it
64
+ # https://github.com/r-lib/cpp11/pull/279
79
65
if : matrix.config.custom == 'gcc 4.8'
80
66
run : |
67
+ echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list
68
+ echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" | sudo tee -a /etc/apt/sources.list
69
+ sudo apt update
81
70
sudo apt-get install -y g++-4.8
82
71
mkdir ~/.R/
83
- echo $'CXX1X=g++-4.8\nCXX11=g++-4.8' >> ~/.R/Makevars
72
+ echo $'CXX1X=g++-4.8\nCXX11=g++-4.8\nCC=gcc-4.8 ' >> ~/.R/Makevars
84
73
85
- - name : install macOS system dependecies
74
+ - name : Install macOS system dependencies
86
75
if : runner.os == 'macOS'
87
76
run : brew install --cask xquartz
88
77
89
- - name : Install dependencies
90
- run : |
91
- pak::local_install_dev_deps(upgrade = TRUE)
92
- pak::pkg_install("rcmdcheck")
93
- shell : Rscript {0}
78
+ - uses : r-lib/actions/setup-r-dependencies@v2
79
+ with :
80
+ extra-packages : any::rcmdcheck
81
+ needs : check
94
82
95
- - name : Install cpp11 and cpp11test
83
+ - name : Install cpp11test
96
84
if : matrix.config.custom != 'no-cpp11test'
97
85
run : |
98
86
options(warn = 2)
99
- install.packages(".", repos = NULL, type = "source")
100
- pak::local_install_dev_deps("cpp11test")
87
+ pak::local_install_dev_deps("cpp11test", dependencies = TRUE)
101
88
install.packages("cpp11test", repos = NULL, INSTALL_opts = "--install-tests", type = "source")
102
89
shell : Rscript {0}
103
90
104
- - name : Session info
105
- run : |
106
- options(width = 100)
107
- pkgs <- installed.packages()[, "Package"]
108
- sessioninfo::session_info(pkgs, include_base = TRUE)
109
- shell : Rscript {0}
110
-
111
- - name : Check
112
- env :
113
- _R_CHECK_CRAN_INCOMING_ : false
114
- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
115
- shell : Rscript {0}
91
+ - uses : r-lib/actions/check-r-package@v2
92
+ with :
93
+ upload-snapshots : true
116
94
117
95
- name : Run cpp11test tests
118
96
if : matrix.config.custom != 'no-cpp11test'
@@ -122,20 +100,3 @@ jobs:
122
100
library(cpp11test)
123
101
test_check("cpp11test", reporter = "progress")
124
102
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
0 commit comments