-
Notifications
You must be signed in to change notification settings - Fork 6
112 lines (93 loc) · 4.26 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
107
108
109
110
111
112
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
name: test-coverage
jobs:
test-coverage:
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release', bioc: '3.18'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@master
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-tinytex@v2
- run: tlmgr --version
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
message(paste('****', Sys.time(), 'installing BiocManager ****'))
remotes::install_cran("BiocManager")
shell: Rscript {0}
## Find the corresponding R version based on the Bioconductor version
## to use for the macOS and Windows checks by the next GHA job
- id: findrversion
name: Find Bioc and R versions
run: |
## Find what branch we are working on
if echo "$GITHUB_REF" | grep -q "master"; then
biocversion="devel"
elif echo "$GITHUB_REF" | grep -q "RELEASE_"; then
biocversion="release"
fi
## Define the R and Bioconductor version numbers
biocversionnum=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'Bioc']; cat(as.character(res))")
rversion=$(Rscript -e "info <- BiocManager:::.version_map_get_online('https://bioconductor.org/config.yaml'); res <- subset(info, BiocStatus == '${biocversion}')[, 'R']; cat(as.character(res))")
## Print the results
echo $biocversion
echo $biocversionnum
echo $rversion
## Save the info for the next job
echo "rversion=${rversion}" >> $GITHUB_OUTPUT
echo "biocversionnum=${biocversionnum}" >> $GITHUB_OUTPUT
# echo "::set-output name=rversion::${rversion}"
# echo "::set-output name=biocversionnum::${biocversionnum}"
shell:
bash {0}
- name: Set BiocVersion
run: |
BiocManager::install(version = "${{ matrix.config.bioc }}", ask = FALSE, update = FALSE)
shell: Rscript {0}
- name: Install dependencies
run: |
install.packages(c("remotes"))
# remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr", type = "binary", dependencies = TRUE)
## remotes::install_deps(dependencies = TRUE)
## remotes::install_cran("rcmdcheck")
### Try installing the package dependencies in steps. First the local
## dependencies, then any remaining dependencies to avoid the
## issues described at
## https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016675.html
## https://github.com/r-lib/remotes/issues/296
## Ideally, all dependencies should get installed in the first pass.
## Pass #1 at installing dependencies
message(paste('****', Sys.time(), 'pass number 1 at installing dependencies: local dependencies ****'))
local_deps <- remotes::local_package_deps(dependencies = TRUE)
deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories())
# BiocManager::install(local_deps[local_deps %in% deps$package[deps$diff != 0]])
BiocManager::install(local_deps, force = TRUE)
## Pass #2 at installing dependencies
message(paste('****', Sys.time(), 'pass number 2 at installing dependencies: any remaining dependencies ****'))
deps <- remotes::dev_package_deps(dependencies = TRUE, repos = BiocManager::repositories())
BiocManager::install(deps$package[deps$diff != 0])
## For running the checks
message(paste('****', Sys.time(), 'installing rcmdcheck and BiocCheck ****'))
remotes::install_cran("rcmdcheck")
BiocManager::install("BiocCheck")
shell: Rscript {0}
- name: Test coverage
run: covr::codecov()
shell: Rscript {0}