forked from stan-dev/cmdstanr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
107 lines (86 loc) · 3.66 KB
/
.appveyor.yml
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
skip_branch_with_pr: true
version: '{build}'
image: Visual Studio 2017
platform:
- x64
# cache:
# - C:\RLibrary
# - C:\RTools
# saving these seems to be working but I'm not sure it's preventing
# installing them again every time (it doesn't obviously save time)
clone_folder: c:\projects\cmdstanr
shallow_clone: true
clone_depth: 1
environment:
HOME: C:\Users\appveyor\
NOT_CRAN: true
# versions
_R_VERSION: "3.6.3"
_RTOOLS_VERSION: "35"
# flags
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_SYSTEM_CLOCK_: false
_R_BUILD_FLAGS: "--no-manual"
_R_CHECK_FLAGS: "--no-manual --as-cran --install-args=--build"
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
# credits: JuliaLang developers.
- ps: |
$ErrorActionPreference = "Stop"
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
& "C:\\Program Files\\Git\\mingw64\\bin\\curl.exe" -s -o ../R-win.exe -L https://cran.rstudio.com/bin/windows/base/R-$env:_R_VERSION-win.exe
echo "Running R installer"
Start-Process -FilePath ..\R-win.exe -ArgumentList "/VERYSILENT /DIR=C:\R" -NoNewWindow -Wait
& "C:\\Program Files\\Git\\mingw64\\bin\\curl.exe" -s -o ../R-tools-win.exe -L https://cran.rstudio.com/bin/windows/Rtools/Rtools$env:_RTOOLS_VERSION.exe
echo "Running RTools installer"
Start-Process -FilePath ..\R-tools-win.exe -ArgumentList /VERYSILENT -NoNewWindow -Wait
echo "Setting R_LIBS_USER"
$env:R_LIBS_USER = 'c:\RLibrary'
if ( -not(Test-Path $env:R_LIBS_USER) ) {
mkdir $env:R_LIBS_USER
}
- SET PATH=C:\\R\\bin\\x64;C:\\Rtools\\bin;C:\\Rtools\\mingw_64\\bin;C:\\Rtools\\mingw_32\\bin;%PATH%
- echo "Printing toolchain information"
- g++ --version
- mingw32-make --version
- echo "Installing R package dependencies"
- Rscript -e "sessionInfo()"
- Rscript -e "install.packages(c('remotes', 'covr', 'knitr', 'xml2'), repos = 'https://cloud.r-project.org')"
- Rscript -e "options(repos = c(CRAN = 'https://cloud.r-project.org'), download.file.method = 'auto')"
- Rscript -e "remotes::install_deps(dependencies = TRUE, type='win.binary')"
- echo "Finished installing R dependencies"
build: false
test_script:
- SET PATH=C:\\R\\bin\\x64;C:\\Rtools\\bin;C:\\Rtools\\mingw_64\\bin;%PATH%
- echo "Build the package"
- R.exe CMD build . %_R_BUILD_FLAGS%
- echo "Install the package so we can call install_cmdstan()"
- R.exe CMD INSTALL .\\cmdstanr_*.tar.gz
- echo "Install CmdStan via cmdstanr::install_cmdstan()"
- Rscript -e "cmdstanr::install_cmdstan(cores = 2, overwrite = TRUE)"
- echo "Check the package"
- R.exe CMD check .\\cmdstanr_*.tar.gz %_R_CHECK_FLAGS%
# on_success:
# - Rscript -e "covr::codecov(quiet=FALSE, line_exclusions = list('R/zzz.R'))"
on_failure:
- 7z a failure.zip *.Rcheck\*
- appveyor PushArtifact failure.zip
artifacts:
- path: '*.Rcheck\**\*.log'
name: Logs
- path: '*.Rcheck\**\*.out'
name: Logs
- path: '*.Rcheck\**\*.fail'
name: Logs
- path: '*.Rcheck\**\*.Rout'
name: Logs
- path: '\*_*.tar.gz'
name: Bits
- path: '\*_*.zip'
name: Bits