This is a solution for continuous integration for R projects on Windows, using AppVeyor -- a CI testing service similar to Travis-CI. Under the hood, r-travis is used to perform the testing; this works even on Windows thanks to MinGW and MSYS.
- Sign up to AppVeyor.
- Enable testing for your project.
- Run
devtools::use_appveyor()
in your project. - (Optional) Adapt
appveyor.yml
to your needs according to the documentation. - (Optional) Add a badge as described by the output of
devtools::use_appveyor()
. - Be sure to supply a
.gitattributes
file that takes care of fixing CRLF conversion settings that are relevant on Windows. The one in this repo can be used for starters. - Push to your repo to start building.
- Enjoy!
The travis-tool
used in appveyor.yml
is a modified copy of the r-travis project, documentation is available on its wiki.
These can be set in the appveyor.yml
, overriding the defaults. This repo tests several configurations at once in a build matrix, see also the build status.
R_VERSION
: The version of R to be used for testing. Specifydevel
,patched
,stable
(orrelease
),oldrel
, or a version number.R_ARCH
: The architecture to be used for testing, one ofi386
(default) orx64
.RTOOLS_VERSION
: The version of Rtools to be used for testing, defaults to the most recent Rtools. Specify e.g.33
for Rtools 3.3.USE_RTOOLS
: SetUSE_RTOOLS: true
if Rtools needs to be installed, e.g. if you use install_github or if there are packages in Remotes: in your DESCRIPTION file. Defaults tofalse
.GCC_PATH
: The path to GCC in the Rtools installation, currently one ofgcc-4.6.3
(default),mingw_32
ormingw_64
.WARNINGS_ARE_ERRORS
: Set to 1 to treat all warnings as errors.CRAN
: The CRAN mirror to use, defaults to RStudio's CDN via HTTPS. Change to HTTP for R 3.1.3 or earlier.R_BUILD_ARGS
: Arguments passed toR CMD build
, defaults to--no-manual
.R_CHECK_ARGS
: Arguments passed toR CMD check
, defaults to--no-manual --as-cran
.
Currently, all builds use the --no-multiarch
switch for checking, and all vignettes (and the VignetteBuilder
entry in DESCRIPTION
) are removed prior to building (due to the absence of pandoc and LaTeX which are likely to be needed).
In contrast to Travis-CI, AppVeyor offers facilities for hosting artifacts. This can be configured by adding a section to the appveyor.yml
. The sample file is configured to deploy logs, and source and binary versions of the built package. Check the "ARTIFACTS" section for your project at AppVeyor.
This wouldn't have been as easy without r-travis and the experience gained there. Thanks!
The win-builder project has been around much longer and provides more comprehensive testing; you still might want to use this service before submitting to CRAN.
(
master-fail
branch, failure expected)
MIT © Kirill Müller.