Coder Social home page Coder Social logo

r-actions's Introduction

R-actions

This repository contains various GitHub Actions for R that can be used in GitHub workflows.

pkg-check

GitHub action to build, install and check an R package.

Minimal example:

  - uses: s-u/R-actions/pkg-check@v2

By default it expects the package's DESCRIPTION file in the root of the repository and no systems dependencies. It will run R CMD build, automatically install package dependencies from CRAN, run R CMD INSTALL and finally R CMD check.

Inputs

  • debian-deps

    Optional list of Debian/Ubuntu packages that need to be installed using apt-get install.

  • macos-deps

    Optional list of macOS dependencies from R-macos recipes that need to be installed. Furhter dependencies are determined recursively based on the avaiable binaries in https://mac.r-project.org/bin/ so you only need to specify direct dependencies.

  • pkg-path

    The subdirectory containing the DESCRIPTION file. Defaults to . (i.e., root of the repository)

  • check-flags

    Additional flags to use for checking (e.g. --as-cran)

  • build-script

    Optional script to use instead of R CMD build (e.g., sh mkdist). It is expected to create the package tar ball one level up from the repository directory (so the same as if one called (cd .. && R CMD build <package>).

Examples

A real example with external system dependencies:

  - uses: s-u/R-actions/pkg-check@v2
    with:
      debian-deps: libtiff-dev
      macos-deps: tiff
      check-flags: --as-cran

See the pkg-check-test repository for this example in action (based on the tiff package).

Full check.yaml example to put in .github/actions which tests on Ubuntu, macOS and Windows:

on: [push, pull_request]

name: Package Check

jobs:
  check:
    runs-on: ${{ matrix.os }}

    name: ${{ matrix.os }} check

    strategy:
      fail-fast: false
      matrix:
        os: [ macos-13, macos-14, ubuntu-22.04, windows-2022 ]
        r-version: [ release, devel ]

    steps:
      - uses: actions/checkout@v4
      
      - uses: s-u/R-actions/install@v2
        with:
          r-version: ${{ matrix.r-version }}
          tools: base

      - uses: s-u/R-actions/pkg-check@v2

install

GitHub action to install R on the runner.

Minimal example:

  - uses: s-u/R-actions/install@v2

This installs a well-defined R based on CRAN tar balls, binaries (macOS and Windows) and releases. It is very fast to run.

Inputs

  • r-version

    Version of R to install. Only devel and release are guaranteed to work on all platforms.

  • tools

    Optional specification of the toolchian to install. Currently this is only used on Windows and passed as the toolchain-type of the toolchain-install actions from ucrt3, so the valid options are none, base and full.

The binaries for the Linux runners are created using the R-build repository based on CRAN nightly tar balls which live in /opt/R/ (with symlinks from /usr/local). The macOS builds come from last-success CRAN builds and Windows build from pre-release CRAN builds.

tinytex

GitHub action to install TinyTex

Minimal example:

  - uses: s-u/R-actions/tinytex@v1

The runners don't have TeX by default so if you want to be able to check R package manuals, you will need to install it in some way and this action is just one of the possible ways.

Inputs

  • flavor

    Optional name of the distribution. The possible values are release names from tinytex-releases with TinyTeX as default. TinyTeX-1 is the minimal distribution for R packages.

  • version

    Optional TinyTeX version number. Defaults to latest which is the latest daily release. See releases for available version numbers.

r-actions's People

Contributors

kalibera avatar s-u avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.