-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.61 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
on:
push:
branches:
- master
pull_request:
branches:
- master
name: test-coverage
# Increment this version when we want to clear cache
env:
cache-version: v1
r-version: 4.0
jobs:
test-coverage:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
with:
r-version: ${{ env.r-version }}
- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@master
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ env.cache-version }}-macOS-r-${{ env.r-version }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ env.cache-version }}-macOS-r-${{ env.r-version }}-
- name: Install system dependencies on macOS
run: |
# XQuartz is needed by vdiffr
brew install xquartz
- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE, type = "binary")
remotes::install_cran("covr")
shell: Rscript {0}
# TODO: Remove remotes::install_github() after covr > 3.5.0 is released
# c.f. https://github.com/r-lib/covr/commit/cc710804aeff6f337777465bf902914197c0b713
- name: Test coverage
run: |
remotes::install_github("r-lib/covr")
covr::codecov()
shell: Rscript {0}