4
4
schedule :
5
5
- cron : " 0 4 * * *"
6
6
7
- name : R-CMD-check / codecov
7
+ name : R-CMD-check
8
8
9
9
jobs :
10
- check-covr :
10
+ R-CMD-check :
11
11
runs-on : ${{ matrix.config.os }}
12
12
13
13
name : ${{ matrix.config.os }} (${{ matrix.config.r }})
@@ -17,79 +17,89 @@ jobs:
17
17
matrix :
18
18
config :
19
19
- {os: windows-latest, r: 'release'}
20
- - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
21
20
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
22
- - {os: ubuntu-20.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
21
+ - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
22
+ - {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
23
23
24
24
env :
25
25
R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
26
26
RSPM : ${{ matrix.config.rspm }}
27
+ GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
27
28
28
29
steps :
29
30
- uses : actions/checkout@v2
30
31
31
- - uses : r-lib/actions/setup-r@master
32
+ - uses : r-lib/actions/setup-r@v1
33
+ id : install-r
32
34
with :
33
35
r-version : ${{ matrix.config.r }}
36
+ http-user-agent : ${{ matrix.config.http-user-agent }}
34
37
35
- - uses : r-lib/actions/setup-pandoc@master
38
+ - uses : r-lib/actions/setup-pandoc@v1
36
39
37
- - name : Query dependencies
40
+ - name : Install pak and query dependencies
38
41
run : |
39
- install.packages('remotes')
40
- saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
41
- writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
42
+ install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
43
+ saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
42
44
shell : Rscript {0}
43
45
44
- - name : Cache R packages
45
- if : runner.os != 'Windows'
46
- uses : actions/cache@v1
46
+ - name : Restore R package cache
47
+ uses : actions/cache@v2
47
48
with :
48
- path : ${{ env.R_LIBS_USER }}
49
- key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
50
- restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
49
+ path : |
50
+ ${{ env.R_LIBS_USER }}/*
51
+ !${{ env.R_LIBS_USER }}/pak
52
+ key : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
53
+ restore-keys : ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
51
54
52
55
- name : Install system dependencies
53
56
if : runner.os == 'Linux'
54
57
run : |
55
- set -x
56
- while read -r cmd
57
- do
58
- eval sudo $cmd
59
- done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
58
+ pak::local_system_requirements(execute = TRUE)
59
+ pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
60
+ shell : Rscript {0}
60
61
61
62
- name : Install dependencies
62
63
run : |
63
- install.packages("remotes")
64
- remotes::install_deps(dependencies = TRUE)
65
- remotes::install_cran("rcmdcheck")
64
+ pak::local_install_dev_deps(upgrade = TRUE)
65
+ pak::pkg_install("rcmdcheck")
66
66
shell : Rscript {0}
67
67
68
- - name : Install self
69
- if : runner.os == 'Windows'
68
+ - name : Session info
70
69
run : |
71
- install.packages(".", repos = NULL, type = "source")
70
+ options(width = 100)
71
+ pkgs <- installed.packages()[, "Package"]
72
+ sessioninfo::session_info(pkgs, include_base = TRUE)
72
73
shell : Rscript {0}
73
74
74
75
- name : Check
75
76
env :
76
- _R_CHECK_CRAN_INCOMING_REMOTE_ : false
77
- run : rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
77
+ _R_CHECK_CRAN_INCOMING_ : false
78
+ run : |
79
+ options(crayon.enabled = TRUE)
80
+ rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
78
81
shell : Rscript {0}
79
82
83
+ - name : Show testthat output
84
+ if : always()
85
+ run : find check -name 'testthat.Rout*' -exec cat '{}' \; || true
86
+ shell : bash
87
+
80
88
- name : Upload check results
81
89
if : failure()
82
90
uses : actions/upload-artifact@main
83
91
with :
84
- name : ${{ runner .os }}-r${{ matrix.config.r }}-results
92
+ name : ${{ matrix.config .os }}-r${{ matrix.config.r }}-results
85
93
path : check
86
94
87
- - name : Install covr
88
- if : ${{ github.event_name == 'pull_request' && runner.os == 'Linux ' && matrix.config.r == 'release' }}
89
- run : install.packages('covr')
90
- shell : Rscript {0}
95
+ - name : Don't use tar from old Rtools to store the cache
96
+ if : ${{ runner.os == 'Windows ' && startsWith(steps.install-r.outputs.installed-r-version, '3.6' ) }}
97
+ shell : bash
98
+ run : echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH
91
99
92
100
- name : Test coverage
93
- if : ${{ github.event_name == 'pull_request' && runner.os == 'Linux' && matrix.config.r == 'release'}}
94
- run : covr::codecov()
101
+ if : ${{ runner.os == 'Linux' && matrix.config.r == 'release'}}
102
+ run : |
103
+ install.packages('covr')
104
+ covr::codecov()
95
105
shell : Rscript {0}
0 commit comments