forked from r-dbi/RSQLite
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (88 loc) · 3.2 KB
/
test-coverage.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
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
name: covr
jobs:
test-coverage:
runs-on: ubuntu-18.04
# Begin custom: services
# End custom: services
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# prevent rgl issues because no X11 display is available
RGL_USE_NULL: true
# Begin custom: env vars
# End custom: env vars
steps:
- name: Check rate limits
run: |
curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit
shell: bash
- uses: actions/checkout@v2
# Begin custom: before install
# End custom: before install
- uses: r-lib/actions/setup-r@v1
with:
install-r: false
- uses: r-lib/actions/setup-pandoc@v1
- name: Install remotes
run: |
if (!requireNamespace("curl", quietly = TRUE)) install.packages("curl")
if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")
shell: Rscript {0}
- name: Query dependencies
if: runner.os != 'Windows'
run: |
saveRDS(remotes::dev_package_deps(dependencies = TRUE, type = .Platform$pkgType), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ubuntu-18.04-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ubuntu-18.04-${{ hashFiles('.github/R-version') }}-2-
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "18.04"))')
- name: Add fake qpdf and checkbashisms
if: runner.os == 'Linux'
run: |
sudo ln -s $(which true) /usr/local/bin/qpdf
sudo ln -s $(which true) /usr/local/bin/checkbashisms
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE, type = .Platform$pkgType)
remotes::install_cran("covr")
shell: Rscript {0}
- name: Session info
run: |
options(width = 100)
if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo")
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}
# Begin custom: after install
# End custom: after install
- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
- name: Check rate limits
if: always()
run: |
curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit
shell: bash