name: 'Setup R environment'
description: 'Setup a R environment and add it to the PATH'
author: 'Jim Hester'
inputs:
  r-version:
    description: 'Version range or exact version of an R version to use. "devel" is
    the current development version, and "next" is the next version of R, either
    R-patched, or R-alpha, R-beta, R-rc or R-prerelease. Use "renv" to retrieve R 
    version recorded in renv.lock file.'
    default: 'release'
  rtools-version:
    description: 'Exact version of Rtools to use. Default uses latest suitable
    rtools for the given version of R. Set it to "42" for Rtools42.'
    default: ''
  Ncpus:
    description: 'Value to set the R option `Ncpus` to.'
    default: '1'
  remove-openmp-macos:
    description: 'If true, remove `-fopenmp` from the default compilation
    flags, e.g. `SHLIB_OPENMP_CFLAGS`, as the macOS Command Line Tools do not
    support OpenMP.'
    default: true
  http-user-agent:
    description: 'If `"default"` or `""`, sets the HTTPUserAgent option to e.g. for
      R 3.6.3 running on macOS Catalina, `"R/3.6.3 R (3.6.3
      x86_64-apple-darwin17.0 x86_64 darwin17.0) on GitHub Actions"`. If
      `"release"` sets the user agent to the default user agent for the current R
      release. Otherwise uses whatever value is passed to `http-user-agent`.'
    default: 'default'
  install-r:
    description: 'If "true" download and install R during the setup. If "false"
      use the existing installation in the GitHub Action image. Note that if it
      is "false", you probably need to run `sudo apt-get update` yourself.'
    default: true
  windows-path-include-rtools:
    description: "Whether to add Rtools to the PATH."
    default: true
  windows-path-include-mingw:
    description: 'If "true" put the 64 bit mingw directory from Rtools on the
    PATH for Windows builds. This argument is now defunct on Rtools40 and later,
    which never add the mingw directory to the path.'
    default: true
  update-rtools:
    description: 'Update rtools40 compilers and libraries to the latest builds.'
    default: false
  use-public-rspm:
    description: 'Use the public version of Posit package manager available
      at https://packagemanager.posit.co/ to serve binaries for Linux and
      Windows.'
    default: false
  extra-repositories:
    description: 'One or more extra CRAN-like repositories to include in the `repos` global option'
    default: ''
outputs:
  installed-r-version:
    description: 'The full R version installed'
runs:
  using: 'node16'
  main: 'lib/setup-r.js'
