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
3
1
on :
4
2
push :
5
3
branches : [main, master]
@@ -10,42 +8,38 @@ name: test-coverage
10
8
11
9
jobs :
12
10
test-coverage :
13
- runs-on : ubuntu -latest
11
+ runs-on : macOS -latest
14
12
env :
15
13
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
16
-
14
+
17
15
steps :
18
- - uses : actions/checkout@v4
16
+ - uses : actions/checkout@v2
19
17
20
18
- uses : r-lib/actions/setup-r@v2
21
- with :
22
- use-public-rspm : true
23
19
24
- - uses : r-lib/actions/setup-r-dependencies@v2
25
- with :
26
- extra-packages : any::covr
27
- needs : coverage
20
+ - uses : r-lib/actions/setup-pandoc@v2
28
21
29
- - name : Test coverage
22
+ - name : Query dependencies
30
23
run : |
31
- covr::codecov(
32
- quiet = FALSE,
33
- clean = FALSE,
34
- install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"),
35
- token = "${{ secrets.CODECOV_TOKEN }}"
36
- )
24
+ install.packages('remotes')
25
+ saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
26
+ writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
37
27
shell : Rscript {0}
38
28
39
- - name : Show testthat output
40
- if : always()
29
+ - name : Restore R package cache
30
+ uses : actions/cache@v2
31
+ with :
32
+ path : ${{ env.R_LIBS_USER }}
33
+ key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
34
+ restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
35
+
36
+ - name : Install dependencies
41
37
run : |
42
- ## --------------------------------------------------------------------
43
- find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
44
- shell : bash
38
+ install.packages(c("remotes"))
39
+ remotes::install_deps(dependencies = TRUE)
40
+ remotes::install_cran("covr")
41
+ shell : Rscript {0}
45
42
46
- - name : Upload test results
47
- if : failure()
48
- uses : actions/upload-artifact@v3
49
- with :
50
- name : coverage-test-failures
51
- path : ${{ runner.temp }}/package
43
+ - name : Test coverage
44
+ run : covr::codecov(token = "${{ secrets.CODECOV_TOKEN }}")
45
+ shell : Rscript {0}
0 commit comments