Skip to content

Latest commit

 

History

History

setup-r

setup-r

RStudio community

This action sets up an R environment for use in actions by:

  • Downloading and caching a version of R by version and adding to PATH
  • Registering problem matchers for error output
  • Setting the following environment variables
    • NOT_CRAN=true
    • TZ=UTC
    • R_LIBS_USER=tempdir/Library
  • Removing the -fopenmp flags from Makeconf on macOS, which are not supported with Apple's default Command Line Tools compilers.

Usage

See action.yml

Basic:

steps:
- uses: actions/checkout@master
- uses: r-lib/actions/setup-r@v1
  with:
    r-version: '3.5.3' # The R version to download (if necessary) and use.
- run: Rscript -e 'print("hello")'

Matrix Testing:

jobs:
  build:
    runs-on: ubuntu-18.04
    strategy:
      matrix:
        R: [ '3.5.3', '3.6.1' ]
    name: R ${{ matrix.R }} sample
    steps:
      - uses: actions/checkout@master
      - name: Setup R
        uses: actions/setup-R@v1
        with:
          r-version: ${{ matrix.R }}
      - run: Rscript -e 'print("hello")'

License

The scripts and documentation in this project are released under the MIT License

Contributions

Contributions are welcome! See Contributor's Guide