-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (62 loc) · 2.64 KB
/
Makefile
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
SHELL=bash
BROWSER=google-chrome
all: install check check-cli
#---------------------------------------------------------------
# Install package
#---------------------------------------------------------------
requirements:
Rscript -e "install.packages(c('knitr', 'rmarkdown'))"
install: doc
Rscript -e "install.packages('.', repos = NULL)"
#---------------------------------------------------------------
# Build documentation
#---------------------------------------------------------------
doc:
Rscript -e "devtools::document()"
#---------------------------------------------------------------
# Build R package tarball
#---------------------------------------------------------------
build: doc
mkdir -p ".local"
rm .local/seguid_*.tar.gz || true
cd ".local" && R CMD build ..
#---------------------------------------------------------------
# Check package
#---------------------------------------------------------------
check: build
cd ".local" && R CMD check --as-cran seguid_*.tar.gz
#---------------------------------------------------------------
# Estimate test code coverage
#---------------------------------------------------------------
coverage-html:
tf=$$(mktemp --suffix="-report.html"); \
Rscript -e "c <- covr::package_coverage(quiet = FALSE); print(c); r <- covr::report(c, file='$${tf}'); utils::browseURL(r, browser = '$(BROWSER)')"
#---------------------------------------------------------------
# Check spelling
#---------------------------------------------------------------
spelling:
Rscript -e "spelling::spell_check_package()"
Rscript -e "spelling::spell_check_files(c('NEWS.md', dir('vignettes', pattern='[.]Rmd$$', full.names=TRUE)), ignore=readLines('inst/WORDLIST', warn=FALSE))"
#---------------------------------------------------------------
# Check via https://win-builder.r-project.org/
#---------------------------------------------------------------
WIN_BUILDER = win-builder.r-project.org
win-builder-devel: .local/seguid_*.tar.gz
curl -v -T "$?" ftp://anonymous@$(WIN_BUILDER)/R-devel/
win-builder-release: .local/seguid_*.tar.gz
curl -v -T "$?" ftp://anonymous@$(WIN_BUILDER)/R-release/
win-builder: win-builder-devel win-builder-release
#---------------------------------------------------------------
# Check CLI using 'seguid-tests' test suite
#---------------------------------------------------------------
add-submodules:
git submodule add https://github.com/seguid/seguid-tests seguid-tests
seguid-tests: .PHONY
git submodule init
git submodule update
cd "$@" && git pull origin main
check-cli: seguid-tests
$(MAKE) -C "$<" check-cli/seguid-r
check-api: seguid-tests
$(MAKE) -C "$<" check-api/seguid-r
.PHONY: