• Stars
    star
    133
  • Rank 272,600 (Top 6 %)
  • Language
    Shell
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tools for using R with AppVeyor (https://appveyor.com)

R + AppVeyor AppVeyor build status Travis-CI Build Status

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.

Usage

  1. Sign up to AppVeyor.
  2. Enable testing for your project.
  3. Run usethis::use_appveyor() in your project.
  4. (Optional) Adapt appveyor.yml to your needs according to the documentation.
  5. (Optional) Add a badge as described by the output of usethis::use_appveyor().
  6. 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.
  7. Push to your repo to start building.
  8. Enjoy!

Build and test commands

The travis-tool used in appveyor.yml is a modified copy of the r-travis project, documentation is available on its wiki.

Environment variables

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.

Example:

environment:
  VARIABLE: value
  • R_VERSION: The version of R to be used for testing. Specify devel, patched, stable (or release), oldrel, or a version number.
  • R_ARCH: The architecture to be used for testing, one of x64 (default) or i386.
  • 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: Set USE_RTOOLS: true (or USE_RTOOLS: yes) if Rtools needs to be installed. Defaults to true if your package has a src/ directory and false otherwise. Rtools may be needed if you use install_github(), if there are packages in Remotes: in your DESCRIPTION file, or if one of your dependencies has updated, but the associated Windows binary is not yet available from CRAN. (Set PKGTYPE=binary to avoid installing packages from source.)
  • GCC_PATH: The path to GCC in the Rtools installation, currently one of gcc-4.6.3 (default), mingw_32 or mingw_64.
  • WARNINGS_ARE_ERRORS: Set to 1 to treat all warnings as errors, otherwise leave empty.
  • 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 to R CMD build, defaults to --no-manual.
  • R_CHECK_ARGS: Arguments passed to R CMD check, defaults to --no-manual --as-cran.
  • PKGTYPE: Passed as type to install.packages(), remotes::install_github() and remotes::install_deps(). Set to both to install packages from source if the source version is more recent than the binary version.
  • NOT_CRAN: Set this to true if you are using testthat and want to run tests marked with testthat::skip_on_cran().
  • R_REMOTES_STANDALONE: Set this to true if builds are failing due to the inability to update infrastructure packages such as curl, git2r and rlang. Read more in the docs for the remotes package.
  • _R_CHECK_FORCE_SUGGESTS_: Set this to false to avoid errors of the form "Package suggested but not available".
  • KEEP_VIGNETTES: Set this to a nonempty value build vignettes. You will likely need LaTeX and/or Pandoc, see below for installation instructions. By default, all vignettes are purged and the VignetteBuilder entry in DESCRIPTION is removed.
  • DOWNLOAD_FILE_METHOD: On some versions of R, setting this to wininet appears to work better than the default auto.

Artifacts

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.

LaTeX

See the example contributed by @pat-s for a way to install LaTeX. The tinytex package is another option.

Pandoc and other software

The Chocolatey installer is a convenient way to install other software. See below for a Pandoc example from the reprex repository:

before_test:
  - cinst pandoc
  - ps: $env:Path += ";C:\Program Files (x86)\Pandoc\"
  - pandoc -v

Troubleshooting

Using a 64-bit R installation

Some R packages, notably rJava, require a 64-bit installation of Windows and R. If you try to install these packages on a 32-bit system you'll see a message similar to:

  Error: .onLoad failed in loadNamespace() for 'rJava', details:
    call: inDL(x, as.logical(local), as.logical(now), ...)
    error: unable to load shared object 'C:/Users/appveyor/AppData/Local/Temp/1/RtmpWa3KNC/RLIBS_bdc2913935/rJava/libs/i386/rJava.dll':
    LoadLibrary failure:  %1 is not a valid Win32 application.

To solve this problem, add to your appveyor.yml:

platform: x64

environment:
  R_ARCH: x64

This will cause Appveyor to run your build on a 64-bit version of Windows Server, using the 64-bit R binary.

Acknowledgements

This wouldn't have been as easy without r-travis and the experience gained there. Thanks!

See also

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.

Other branches

Build status for expected failure (master-fail branch, failure expected)

License

MIT Β© Kirill MΓΌller.

More Repositories

1

awesome-vctrs

A curated list of amazingly awesome R vector classes
106
star
2

fstplyr

A dplyr interface to fst
R
32
star
3

MakefileR

Create Makefiles using R
R
31
star
4

drake-sib-zurich

Workshop repository for the "Make-like declarative workflows with R" tutorial at the SIB in Zurich, March 5, 2018
R
31
star
5

bindr

Parametrized active bindings
R
26
star
6

plogr

R bindings for the plog C++ logging library
C++
26
star
7

remake-tutorial

A hands-on tutorial for remake
R
25
star
8

actions-sync

Manage GitHub Actions workflows across repositories
Shell
24
star
9

ulimit

Limit memory usage of R processes on POSIX systems | Obsolete, use this instead:
R
24
star
10

brushthat

Brush up your tests!
R
20
star
11

minver

What are the minimum dependencies for your package?
R
19
star
12

tidyduck

High-level R bindings for the DuckDB Database Management System
R
19
star
13

wrswoR

A package with different implementations of weighted random sampling without replacement in R
TeX
18
star
14

bindrcpp

An Rcpp interface to active bindings
C++
17
star
15

kimisc

Kirill's miscellaneous functions
R
16
star
16

mockr

Drop-in replacement for testthat::with_mock()
R
15
star
17

enc

A simple class for storing UTF-8 strings
R
14
star
18

deparse

A nicer deparse
R
12
star
19

scriptlets

A collection of tiny but helpful shell scripts and config files for personal use. Tested on Ubuntu
Shell
11
star
20

duckdbneo

New Bindings for the DuckDB Database Management System
C
10
star
21

tee

Log all process output to a file, for R
R
9
star
22

tidyprog

Material for the "Programming in the tidyverse" workshop
R
9
star
23

drake-pitch

A brief pitch for drake
CSS
8
star
24

duckdb-r

R
8
star
25

pkgfiles

Statistics and Tools for Files in Your R Project
R
7
star
26

cooking

Cooking with R
R
6
star
27

condition

Missing parts of base R's wonderful condition system
R
6
star
28

duckplyr

Relational API for alternative dplyr implementations
R
6
star
29

shinyodbc

A Shiny app to investigate ODBC connectivity
R
5
star
30

stringpool

Understand R's Global String Pool
C++
4
star
31

redrake

Simple reproducible workflows
R
4
star
32

git-sh-workshop

Repo for git-sh workshop
Shell
3
star
33

misc

Doing away with unnamed RStudio tabs
R
3
star
34

tidyprog-proj

Programming in the tidyverse: Supporting files
R
3
star
35

obtw

Simplify Checks in a Pipeline
R
3
star
36

dplyr.benchmark

dplyr benchmarks
R
2
star
37

remake-slides

Slides for remake presentation
Makefile
2
star
38

conmgr

Managing database (and other) connections
2
star
39

ggmapStitch

Stitching ggmaps
R
2
star
40

tibblize

Make functions tibble-friendly
R
2
star
41

pkgdep

Package dependencies, the tidy way
R
2
star
42

mangow

Generate a Manhattan Distance problem from a Gower's distance problem
R
2
star
43

conda-r

Dockerfile for Ubuntu + conda + R + devtools
Shell
2
star
44

matsim-readers

Convert a MATSim events file to a SQLite3 database
Python
2
star
45

evince_eclipse

Python
2
star
46

import.gen

Generate import calls
R
2
star
47

texlive-dummy-ubuntu

A dummy package for Ubuntu that claims that it provides a complete TeXlive installation
2
star
48

tidyview

Implements a Data Viewer and a Method to Override
R
2
star
49

rextdata

Simple Access to Data Stored in "extdata" Directory
R
1
star
50

r-minimal

Testing GHCR
Dockerfile
1
star
51

git-subbranch

A solution for maintaining an independent gh-pages branch
Shell
1
star
52

RANN1

Fast Nearest Neighbour Search (wraps ANN library) with Manhattan metric
C++
1
star
53

rigraph-san

Debug builds of R for igrao
Dockerfile
1
star
54

lm-template

A template for a LaTeX MWE
Makefile
1
star
55

rig-centos7

A Docker image based on CentOS 7 with R release and devel installed via rig
Dockerfile
1
star
56

spinR

A Makefile to compile R + Markdown + LaTeX scripts
R
1
star
57

spinR-example

R
1
star
58

histmatch

Weighted histogram matching
R
1
star
59

grake

Generalized raking as described by Deville et al. (1993)
R
1
star
60

chkchk

Code elision during load time for chk
R
1
star
61

darn

Directed Acyclic R Script Networks
R
1
star
62

notifierr

Desktop notifications for R
R
1
star
63

dplyr-build

Build environment for dplyr for CLion
CMake
1
star
64

pdlyr

Compatibility package to help loading both plyr and dplyr in the same session
R
1
star
65

scalar

Scalars
R
1
star
66

rigraph-forensics

Running old igraph versions
R
1
star
67

dfunbind

Column-wise loading of large data frames for authors of R packages
R
1
star