-
Notifications
You must be signed in to change notification settings - Fork 1
135 lines (116 loc) · 3.95 KB
/
R-CMD-check-ubuntu.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
schedule:
- cron: 0 0 * * 1 # schedule to run at midnight on Monday each week
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
name: Ubuntu
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'devel'}
- {os: ubuntu-20.04, r: 'devel', pkgs: 'depends only'}
env:
_R_REMOTES_NO_ERRORS_FROM_WARNINGS_: true
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_TIMINGS_: 10
_R_CHECK_CRAN_INCOMING_REMOTE_: false
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
GGMAP_KEY: ${{ secrets.GGMAP_STADIAMAPS_API_KEY }}
CI: true
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
- name: Install system dependencies
run: |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt-get install \
libgdal-dev libgeos-dev libproj-dev gdal-bin grass \
libgmp3-dev libmpfr-dev libudunits2-dev \
libharfbuzz-dev libfribidi-dev
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 4
extra-packages: |
any::covr
any::rcmdcheck
any::remotes
cran/XML
cran/dotCall64
prepr=?ignore
link2GI=?ignore
rgrass=?ignore
smoothr=?ignore
OpenMPController=?ignore
needs: |
check
coverage
- name: Install spatial R packages
run: |
options(repos = "https://cloud.r-project.org/")
install.packages("sf")
install.packages("terra")
install.packages("lwgeom")
install.packages("link2GI")
install.packages("rgrass")
install.packages("smoothr")
remotes::install_github("prioritizr/prepr")
shell: Rscript {0}
- name: Session information
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
- name: Set R environmental variables
run: |
echo GGMAP_STADIAMAPS_API_KEY="$GGMAP_KEY" >> ~/.Renviron
shell: bash
- name: Environmental variables
if: matrix.config.pkgs == 'depends only'
run: |
echo "_R_CHECK_DEPENDS_ONLY_=true" >> $GITHUB_ENV
- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran", "--no-build-vignettes")'
upload-snapshots: true
- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
- name: Test coverage
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}
- uses: codecov/codecov-action@v4
if: runner.os == 'Linux' && matrix.config.r == 'release'
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}