Learn R Programming

tic

The goal of tic is to enhance and simplify working with continuous integration (CI) systems.

The following ones are supported:

To learn more about CI, read the "Travis CI for test automation" blog post and our Getting Started vignette.

The most important improvements over existing solutions are:

  1. Deployment to a Git repository is greatly simplified. Update your repository with results from the CI build.

  2. Support for R packages and other kinds of project (bookdown, blogdown, etc.), with predefined templates. Set up your project to deploy rendered versions of your book or blog with a single push to Git.

  3. Workflow specification in a single .R file, regardless of CI system used.
    Forget about .yml files or web browser configurations.

Installation

{tic} can be installed from GitHub with:

remotes::install_github("ropensci/tic")

Setup

By calling tic::use_tic() a production ready CI setup is initialized, tailored to your specific R project. The created templates will use the providers https://travis-ci.com, https://appveyor.com and https://circleci.com. For more information about the difference between https://travis-ci.org and https://travis-ci.com see the vignette about Travis CI '.org' vs '.com'.

If only the CI YAML templates from {tic} are desired, the use_<provider>_yml() functions can be used. Refer to the complete list of options.

For an R package, the following steps will be set up for the CI workflow:

  • Installation of required dependencies for the project (by checking the mandatory(!) DESCRIPTION file)
  • Satisfying build-time dependencies of steps to be run in all CI stages (by scraping pkg::fun calls in tic.R)
  • Checking of package via rcmdcheck::rcmdcheck()
  • Creation of a pkgdown site including Github deployment
  • Running a code coverage and upload to codecov.io

See the Getting Started vignette for more information and links to minimal example repositories for various R projects (package, blogdown, bookdown and more).

Good to know

We would like to mention that {tic} is a choice and sits on top of existing community efforts providing R support for various CI providers. While {tic} will prevent you from dealing/learning every CIs YAML syntax, you will have to learn {tic}'s way of specifying your tasks on CI systems.

Also, there is no way around familiarizing yourself with the basics of CI systems in general. Without this knowledge, you will also have a hard way understanding {tic}.

There is not yet an automated way of updating the templates installed by {tic}, hence you need to manually check every once in a while if we made some changes to the templates.

We also recommend to take a look at the projects providing the direct R support for each CI system (which {tic} builds upon) to gain a deeper understanding of the whole concept.

Examples

All examples listed here work with Travis, some work with AppVeyor too. The badges link to the most recent build of the master branch.

Vignettes

Limitations

The setup functions in this package assume Git as version control system, and GitHub as platform. Automated setup works best if the project under test is located in the root of the Git repository. Multi-project repositories are not supported, see the comment by @jwijffels for guidance to work around this limitation.


Copy Link

Version

Version

0.4.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

September 8th, 2021

Functions in tic (0.4.0)

TicStep

The base class for all steps
Deprecated

Deprecated functions
macro

Macros
use_tic

Initialize CI testing using tic
base64serialize

Helpers for converting R objects to strings and back
step_setup_push_deploy

Step: Setup push deploy
do_pkgdown

Build pkgdown documentation
run_stage

Run a stage
do_package_checks

Add default checks for packages
step_setup_ssh

Step: Setup SSH
run_all_stages

Emulate a CI run locally
prepare_all_stages

Prepare all stages
yaml-templates

Use CI YAML templates
ci

The current CI environment
stages

Predefined stages
step_add_to_drat

Step: Add built package to a drat
step_install_ssh_keys

Step: Install an SSH key
step_test_ssh

Step: Test SSH connection
step_push_deploy

Step: Setup and perform push deploy
step_write_text_file

Step: Write a text file
step_install_pkg

Step: Install packages
step_hello_world

Step: Hello, world!
do_bookdown

Build a bookdown book
step_add_to_known_hosts

Step: Add to known hosts
do_drat

Build and deploy drat repository
step_rcmdcheck

Step: Check a package
step_build_bookdown

Step: Build a bookdown book
step_run_code

Step: Run arbitrary R code
dsl

tic's domain-specific language
dsl_get

Stages and steps
reexports

Objects exported from other packages
tic-package

tic: Tasks Integrating Continuously: CI-Agnostic Workflow Definitions
step_build_pkgdown

Step: Build pkgdown documentation
repo

Shortcuts for accessing CRAN-like repositories
step_do_push_deploy

Step: Perform push deploy