Giter Site home page Giter Site logo

r-lib / actions Goto Github PK

View Code? Open in Web Editor NEW
924.0 924.0 197.0 34.38 MB

GitHub Actions for the R community

License: Creative Commons Zero v1.0 Universal

TypeScript 93.40% HTML 0.12% R 0.90% Shell 1.05% Makefile 2.46% C 1.36% Dockerfile 0.70%
github-actions r

actions's People

Contributors

actions-user avatar alanguillaume avatar arisp99 avatar bisaloo avatar cderv avatar coatless avatar davidchall avatar davisvaughan avatar dependabot[bot] avatar dpprdan avatar gaborcsardi avatar hadley avatar ijlyttle avatar imanuelcostigan avatar indrajeetpatil avatar iqis avatar jennybc avatar jeroen avatar jimhester avatar krlmlr avatar lightbridge-ks avatar maelle avatar maxheld83 avatar milanmlft avatar nealrichardson avatar randy3k avatar remlapmot avatar riccardoporreca avatar schloerke avatar tnonet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

actions's Issues

Blogdown / Bookdown package cache path error

Is the path to the renv package cache correct here? It seems to be trying to append it as a relative path to the current directory.

path: $HOME/.local/share/renv

For me, I see:

https://github.com/DavisVaughan/r-extensions/runs/579215093?check_suite_focus=true

Post job cleanup.
/usr/bin/tar -cz -f /Users/runner/runners/2.168.0/work/_temp/194d01a0-7d29-4e36-ae3f-8dab3742b905/cache.tgz -C /Users/runner/runners/2.168.0/work/r-extensions/r-extensions/$HOME/.local/share/renv .
tar: could not chdir to '/Users/runner/runners/2.168.0/work/r-extensions/r-extensions/$HOME/.local/share/renv'

[warning]Tar failed with error: The process '/usr/bin/tar' failed with exit code 1

And then on subsequent runs I get stuck in a loop where the pre-cache step says that there is no cache found:

Run actions/cache@v1
Cache not found for input keys: r-453a2d65c821c2b42619477860dc167ca1a5033ddd8e234267b681f9b7b9894f, r-.

But the cache step says there is already a cache:

Post job cleanup.
[warning]Cache already exists. Scope: refs/heads/master, Key: r-453a2d65c821c2b42619477860dc167ca1a5033ddd8e234267b681f9b7b9894f, Version: (null)

https://github.com/DavisVaughan/r-extensions/runs/579268046?check_suite_focus=true

The only way to break out of that loop seems to be to set a new cache key, as described here, but that still doesn't fix the path issue

setup-tensorflow

The current config in travis is (assumes that the R tensorflow package is installed):

env:
  global:
  - KERAS_BACKEND="tensorflow"

before_script:
  - python -m pip install --upgrade --ignore-installed --user travis pip setuptools wheel virtualenv
  - python -m pip install --upgrade --ignore-installed --user travis keras h5py pyyaml requests Pillow scipy theano
  - R -e 'tensorflow::install_tensorflow()'

before_install:
  - sudo apt-get update
  - sudo apt-get -y install python3

!pdfTeX error: pdflatex (file tcrm1000): Font tcrm1000 at 600 not found

My builds are selectively failing for Mac OS 3.6 config-

image

with the following error:

##[warning]LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
!pdfTeX error: pdflatex (file tcrm1000): Font tcrm1000 at 600 not found
 ==> Fatal error occurred, no output PDF file produced!
* checking PDF version of manual without hyperrefs or index ... ERROR
##[error]* DONE

Status: 1 ERROR, 1 WARNING
See/Users/runner/runners/2.163.1/work/broomExtra/broomExtra/check/broomExtra.Rcheck/00check.logfor details.

Detailed log: https://github.com/IndrajeetPatil/broomExtra/runs/372837238
Workflows: https://github.com/IndrajeetPatil/broomExtra/tree/master/.github/workflows

How can I change the workflow to avoid this?

Spontaneous repository issues with setup-r using ubuntu-latest runner

I can no longer set up R on Ubuntu through the setup-r action. This happened spontaneously about 3 hours ago. The setup-r step "succeeds" with the below error, but subsequent steps fail because Rscript cannot be found.

Run r-lib/actions/setup-r@master
Added matchers: 'rcmdcheck'. Problem matchers scan action output for known warning or error strings and report these inline.
Added matchers: 'testthat'. Problem matchers scan action output for known warning or error strings and report these inline.
Added matchers: 'r'. Problem matchers scan action output for known warning or error strings and report these inline.
sudo DEBIAN_FRONTEND=noninteractive apt-get update -qq
W: Conflicting distribution: https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic InRelease (expected bionic but got stable)
E: Repository 'https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic InRelease' changed its 'Origin' value from 'microsoft-ubuntu-bionic-prod bionic' to 'vscode stable'
E: Repository 'https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic InRelease' changed its 'Label' value from 'microsoft-ubuntu-bionic-prod bionic' to 'vscode stable'
E: Repository 'https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic InRelease' changed its 'Suite' value from 'bionic' to 'stable'
E: Repository 'https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic InRelease' changed its 'Codename' value from 'bionic' to 'stable'
W: Conflicting distribution: https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease (expected xenial but got stable)
E: Repository 'https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease' changed its 'Origin' value from 'microsoft-ubuntu-xenial-prod xenial' to 'vscode stable'
E: Repository 'https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease' changed its 'Label' value from 'microsoft-ubuntu-xenial-prod xenial' to 'vscode stable'
E: Repository 'https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease' changed its 'Suite' value from 'xenial' to 'stable'
E: Repository 'https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease' changed its 'Codename' value from 'xenial' to 'stable'
(node:4886) UnhandledPromiseRejectionWarning: Failed to install R: Error: The process 'sudo' failed with exit code 100
(node:4886) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:4886) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I've set up an empty R package with a basic workflow to reproduce the error. I've used the yaml file as generated by usethis::use_github_actions(), but I've changed the runner to ubuntu-latest. You can find the failed workflow here.

R-CMD-check.yaml contents:

on: [push, pull_request]

name: R-CMD-check

jobs:
  R-CMD-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: r-lib/actions/setup-r@master
      - name: Install dependencies
        run: Rscript -e "install.packages(c('remotes', 'rcmdcheck'))" -e "remotes::install_deps(dependencies = TRUE)"
      - name: Check
        run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error')"

R-devel macOS: Toolchain changes

Two days ago Simon announced that R4.0 will use gfortran 8.2 and Apples native compiler along with the SDK 10.13.

There is a new alpha R4.0 branch that contains the latest R-devel changes: https://mac.r-project.org/.
There is a need to switch to the new gfortran version and change the URL for getting the R-devel tarball.

The R-devel el-capitan build is stuck at March-25 and might no longer be updated (not 100% sure about this though).

FYI: There are known issues with the 10.15 SDK (Rcpp issues you are most likely aware of, igraph issues). Therefore I am using a custom install of the 10.13 SDK. Maybe you also want to use that as the default SDK on Actions to mimic CRAN behavior?

wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.13.sdk.tar.xz
tar fxz MacOSX10.13.sdk.tar.xz
sudo mv MacOSX10.13.sdk /Library/Developer/CommandLineTools/SDKs/
rm -rf MacOSX10.13*

.R/Makevars

CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk
CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk
CXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk
CPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk

install system dependencies failure on ubuntu-16.04 (3.5)

There was a failure for the CI build of embed but only for ubuntu-16.04 (3.5):

Run Rscript -e "remotes::install_github('r-hub/sysreqs')"
  Rscript -e "remotes::install_github('r-hub/sysreqs')"
  sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
  sudo -s eval "$sysreqs"
  shell: /bin/bash -e {0}
  env:
    R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
    PIP_NO_WARN_SCRIPT_LOCATION: false
    RSPM: https://demo.rstudiopm.com/all/__linux__/xenial/latest
    R_LIBS_USER: /home/runner/work/_temp/Library
    CI: true
    TZ: UTC
    NOT_CRAN: true
    RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
Error in rbind(info, getNamespaceInfo(env, "S3methods")) : 
  number of columns of matrices must match (see arg 2)
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
##[error]Process completed with exit code 1.

Perhaps this is a bad R version for a dependency (it is the only 3.5 build that I did) but it was previously working yesterday.

TeX packages for building documentation

First of all, thank you so much for these awesome actions. They've helped immensely transition over to GH actions from Travis.

I've noticed a bit of instability with what TeX packages end up being installed when using the setup-tinyetex action. After reading the source, I found that by default TinyTeX is installing the list of packages at https://raw.githubusercontent.com/yihui/tinytex/master/tools/pkgs-custom.txt and it looks like the oberdiek package has been changed and no longer includes kvoptions and pdftexcmds (among others) https://ctan.org/ctan-ann/id/[email protected]

I've also submitted an issue to TinyTeX to resolve this up stream, but in the interim, I forked this repo and added an explicit check/install of all of the packages I've found necessary in the manual creation process. I'm happy to submit a PR for this, though if it's resolved in TinyTeX it's not strictly necessary any more.

I've made an incredibly minimal (and useless!) package to show the issue at https://github.com/jonkeane/simple-package see the error in the action around https://github.com/jonkeane/simple-package/runs/329317228#step:7:71 The setup-tinytex stage completes fine, but when R CMD check is run, the manual isn't able to be built because it can't find pdftexcmds.sty

/reprex issue trigger

I think a /reprex trigger would be useful, similar to /document and /style in pr-commands.yaml.

In the pkgdown repo, we are asking for a reprex more often to debug obscure issues, and it would be nice to provide some consistency to these messages.

A /reprex trigger would:

  • Answer the issue with some stock language, politely asking for the user to create reprex and explaining why.
  • Possibly link to a particularly useful issue where a reprex has been helpful in the past.
  • Point the user to instructions on creating a reprex, similar to what we have in the pkgdown CONTRIBUTING guide.
  • Add a reprex label to the issue.

Timeout on R-CMD-CHECK action

Hi,

Not sure if this is the best place to ask this but I've been testing usethis::use_github_actions_check_release for my package.

It generally has been working however occasionally it fails due to a timeout error during the rebuilding of vignettes. It seems that the timeout is set to 10000ms (i.e. 10s).

The checks all pass fine locally, on travis-CI and seem to sometimes pass on github actions. You can see an example PR that passes on travis-CI but fails on github actions due to timeout here

Example error below (from here)

Quitting from lines 36-42 (elo-ratings-example.Rmd) 
##[error]Error: processing vignette 'elo-ratings-example.Rmd' failed with diagnostics:
Timeout was reached: [afltables.com] Operation timed out after 10091 milliseconds with 0 out of 0 bytes received
--- failed re-building ‘elo-ratings-example.Rmd’

Is there a way to increase this timeout at all in the YML for the R-CMD-CHECK action?

Pkgdown example

Based on discussion in maxheld83/ghpages#1, maxheld83/ghpages#18, and reading GitHub's Authenticating with the GITHUB_TOKEN help doc, I think the Pkgdown github action example needs to be switched from:

- name: Deploy package
run: |
Rscript -e "pkgdown:::deploy_local(new_process = FALSE, remote_url = 'https://x-access-token:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git')"

To:

run: |
   pkgdown:::deploy_local(new_process = FALSE, remote_url = 'https://x-access-token:${{secrets.DEPLOY_PAT}}@github.com/${{github.repository}}.git')
   shell: Rscript {0}

Emphasize that DEPLOY_PAT needs to be generated once and manually set for each repo under Secrets.

Make use of the cache for \style for speed gains

Problem

The command \style takes long because styler is generally slow (I am allowed to say it because I wrote most of it -.- haha).

Solution: use the cache

As of styler v1.3.0, repeated styling is almost instantaneous because of caching (of whole files but also of top-level expressions). If the cache is activated. And I think it's fair to say that in a PR, only a minority of top-level expressions is changed. {styler} uses the {R.cache} backend for caching, and the location of the cache can be specified with R.cache::setCacheRootPath("/path/to/cache"), best in the same R session we call styler::style_pkg(). Then, we'd have to cache that directory to benefit from speed gains.

I think it's a small thing to implement this, but I have no clue about GitHub Actions, so I hope someone else shows interest in making a code contribution.

covr

I used the "Tidyverse CI workflow" example, but I had to add install.packages('covr') obtaining

      - name: Test coverage
        if: matrix.config.os == 'macOS-latest' && matrix.config.r == '3.6'
        run:  |
          install.packages('covr')
          covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")
        shell: Rscript {0}

before it worked.

Not sure if that is indeed needed or not, but for me it didn't work unless I installed covr first.

Cache R installation on Windows

On Windows, it would be useful to cache the R installation. I've been informed that the r-lib/actions/setup-r action doesn't just install R (and Rtools); it also sets up environment variables and PATH.

GH Action failure on macOS only - X11 related?

Describe the bug
I have a build that is passing on all systems except macOS. The error occurs when trying to install the package gdtools (https://github.com/davidgohel/gdtools). The main page for the package lists additional software that needs to be available for this package, X11. The software requirement is additionally documented here: https://cran.r-project.org/bin/macosx/

To Reproduce
Here is a link to the most recent failed build log: https://github.com/ddsjoberg/gtsummary/pull/437/checks?check_run_id=574965508

Expected behavior
As this is only occurring on macOS with the package that needs X11, I assume this is the reason for the error.

Additional context
Apologies if this is not the correct space for reporting! Thank you!

YAML folds seem to not be parsed correctly

Describe the bug
The check-full.yaml workflow has YAML fold block notation on some run statements, which don't seem to be parsed correctly. With the folds:

run: >
  Rscript 
    -e "install.packages('remotes')" 
    -e "saveRDS(remotes::dev_package_deps(dependencies = TRUE), 'depends.Rds', version = 2)"

Rscript does not receive the -e arguments and thus expects a file, which is does not receive.

To Reproduce
Create a new repository with the most recent check-full.yaml workflow and let the workflow run. The workflow should fail at the "Query dependencies" stage (example run logs). Output should be the Rscript usage statements and an error:

Usage: /path/to/Rscript [--options] [-e expr [-e expr2 ...] | file] [args]

--options accepted are
  --help              Print usage and exit
  --version           Print version and exit
  --verbose           Print information on progress
  --default-packages=list
                      Where 'list' is a comma-separated set
                        of package names, or 'NULL'
or options to R, in addition to --slave --no-restore, such as
  --save              Do save workspace at the end of the session
  --no-environ        Don't read the site and user environment files
  --no-site-file      Don't read the site-wide Rprofile
  --no-init-file      Don't read the user R profile
  --restore           Do restore previously saved objects at startup
  --vanilla           Combine --no-save, --no-restore, --no-site-file
                        --no-init-file and --no-environ

'file' may contain spaces but not shell metacharacters
Expressions (one or more '-e <expr>') may be used *instead* of 'file'
See also  ?Rscript  from within R
##[error]Process completed with exit code 1.

Expected behavior
The workflow should run as if the run commands were written in a single line (example workflow success with single line revisions)

Additional context
I decided to open an issue because usethis pulls from these example scripts, which would be causing downstream workflow failures.

r-lib/actions/setup-pandoc fails on windows with pandoc-version 2.9.1

I'm looking to use r-lib/actions/setup-pandoc for manubot/manubot#197. Our install command is:

    - name: Install Pandoc
      uses: r-lib/actions/setup-pandoc@v1
      with:
        pandoc-version: 2.9.1

We're getting failure on windows:

pandoc : The term 'pandoc' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At D:\a\_temp\13e5f803-7724-40c7-9f0c-bf38ac617eb9.ps1:2 char:17
+ echo "# Test" | pandoc -t html
+                 ~~~~~~
+ CategoryInfo          : ObjectNotFound: (pandoc:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : CommandNotFoundException

It seems that mac and linux installation succeeded. CC @jimhester

Hash Sum mismatch for ubuntu-16.04 builds

E: Failed to fetch https://packages.microsoft.com/ubuntu/16.04/prod/dists/xenial/main/binary-amd64/Packages.bz2  Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

To Reproduce

workflow.yml
log

Expected behavior

successfully pass the stage

      - uses: r-lib/actions/setup-r@master
        with:
          r-version: ${{ matrix.config.r }}

Post cache R package clean up warnings

The post cache R package clean up seems to fail in different ways on different platforms:

On macOS:

Post job cleanup.
Cache hit occurred on the primary key macOS-r-3.6-9d6d6298c76f4d3f6969ba02e70924fc899df6ede745c821d69e7bc6c7583a2c, not saving cache.

On Windows:

Post job cleanup.
C:\Rtools\bin\tar.exe -cz --force-local -f d:/a/_temp/b77bb8ee-0267-4c3e-a392-f0271711ce95/cache.tgz -C d:/a/_temp/Library .
tar (child): gzip: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
/Rtools/bin/tar: d\:/a/_temp/b77bb8ee-0267-4c3e-a392-f0271711ce95/cache.tgz: Cannot write: Broken pipe
/Rtools/bin/tar: Child returned status 2
/Rtools/bin/tar: Error is not recoverable: exiting now
##[warning]The process 'C:\Rtools\bin\tar.exe' failed with exit code 2

On Ubuntu:

Post job cleanup.
Cache hit occurred on the primary key Linux-r-3.6-9d6d6298c76f4d3f6969ba02e70924fc899df6ede745c821d69e7bc6c7583a2c, not saving cache

Failed dependency install – `'knitr' not found`

Bug
On the Windows build [only], it's not finding the knitr package:

Run Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error', check_dir = 'check')"
  Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'error', check_dir = 'check')"
  shell: C:\Program Files\PowerShell\6\pwsh.EXE -command ". '{0}'"
  env:
    R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
    CRAN: 
    BOTOMETER_KEY: ***
    TWITTER_ACCESS_TOKEN: ***
    TWITTER_ACCESS_SECRET: ***
    R_LIBS_USER: d:\a\_temp\Library
    CI: true
    TZ: UTC
    NOT_CRAN: true
-- R CMD build -----------------------------------------------------------------
* checking for file 'D:\a\tweetbotornot2\tweetbotornot2/DESCRIPTION' ... OK

* preparing 'tweetbotornot2':

* checking DESCRIPTION meta-information ... OK

Error in loadVignetteBuilder(pkgdir, TRUE) : 

  vignette builder 'knitr' not found

Execution halted

##[error]Error in proc$get_built_file() : Build process failed

Logs
Link to the full logs of the failed build: https://github.com/mkearney/tweetbotornot2

Expected behavior
The build works on Ubuntu and MacOS

Additional context
It seems knitr failed to install because it couldn't find stringi (see relevant portion of log below). So I don't know if this is a problem with knitr or just a momentary Windows bug (b/c it's being built from source). It seems like something I can fix (so I'm not worried about my build), but I figured you might want to know about it because maybe there is some underlying cause that is useful to know about?

2020-02-09T16:31:26.2020937Z * installing *source* package 'knitr' ...
2020-02-09T16:31:26.2374920Z ** package 'knitr' successfully unpacked and MD5 sums checked
2020-02-09T16:31:26.2376823Z ** using staged installation
2020-02-09T16:31:26.5377949Z ** R
2020-02-09T16:31:26.6165482Z ** demo
2020-02-09T16:31:26.6210157Z ** inst
2020-02-09T16:31:26.9458491Z ** byte-compile and prepare package for lazy loading
2020-02-09T16:31:27.5003007Z Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
2020-02-09T16:31:27.5003428Z ERROR: lazy loading failed for package 'knitr'
2020-02-09T16:31:27.5003641Z   there is no package called 'stringi'
2020-02-09T16:31:27.5005186Z ##[error]Error: unable to load R code in package 'knitr'
2020-02-09T16:31:27.5008648Z * removing 'd:/a/_temp/Library/knitr'
2020-02-09T16:31:27.5009041Z Execution halted
2020-02-09T16:31:31.9463648Z * installing *source* package 'stringi' ...

support `r-version: latest` in setup-r

The docker containers, e.g. rocker/tidyverse, use latest to refer to the latest release of R. I think it's a good idea to also support latest in the setup-r actions to make the flow more consistent.

Mac-os devel : issue while installing the `fs` package.

Open an issue here only if you have a bug in one of the
custom R specific actions themselves. -> Please tell me if it's not the right place, i thought for this kind of bug installing a R package this might be the right place, but i might be wrong.

Describe the bug
The fs package does not install on the mac-os devel plateform.

To Reproduce
See the github action repport of my package there : https://github.com/lrnv/cort/runs/522178146#step:15:2856 , lines 2856 -> 2923

Expected behavior
The package should install properly. fs is a dependency of pkgdown, and i dont get why it does not work as other builds for other packages do install pkgdown without encountering this issue.

Additional context
I used tic::use_tic() so setup the whole thing.

Some environment variables are not setting correctly

Expected behaviour:

After installing R, expect to see the following environment variables sets: R_LIBS_USER, CI, TZ and NOT_CRAN per what is specified in the setREnvironmentVariables() function.

Actual behaviour:

The first two envvars are set correctly. However:

  1. NOT_CRAN does not appear to set on any platform and
  2. TZ appears to be set in a malformed way on Windows only (?) and needs to be overridden by specifying this in the env step in the workflow.

You can see the TZ behaviour by comparing two builds: before setting TZ in the workflow and after setting TZ in the workflow

lintr workflow

It would be nice to have a good solution for lintr. A simple workflow is something like this

jobs:
  lintr:
    runs-on: macOS-latest
    steps:
      - uses: actions/checkout@master
      - uses: r-lib/actions/setup-r@master
      - name: Install dependencies
        run: |
          install.packages(c("remotes", "lintr"))
          remotes::install_deps(dependencies = TRUE)
        shell: Rscript {0}
      - name: Install package
        run: R CMD INSTALL .
      - name: Lint package
        run: lintr::lint_package()
        shell: Rscript {0}

However it would also be nice

  1. fail the build when there are any lints
  2. show lints as annotations using logging commands

Use keyword to skip checking

I wonder if it is possible to e.g. use a keyword (e.g. -notest) in the commit message, and look for this in the build to skip it.
For example, if I'm only correcting a typo, it feels like wasting resources to run the tests again.

Matchers are throwing false positives

I'm seeing a failure thrown in this build as I install package dependencies. I can't see why a failure is being thrown by this. There are some Rd compilation warnings, but it doesn't look like the matcher regex's you've set up should catch those.

Add example with running everything in a docker container

Something like this

on: [push]
jobs:
  job1:
    runs-on: ubuntu-latest
    container: rocker/verse
    steps:
      - uses: actions/checkout@v1
      - run: Rscript fit_model.R
      - run: Rscript build_reports.R
      - name: Upload results
        uses: actions/upload-artifact@master
        with:
          name: results
          path: /path/to/artifacts/

About using binaries vs. installing from source

Hi Jim,

thanks a lot for the effort in getting GH actions to work easily for R packages. Just browsed your rstudio::conf slides.

We are in the process to support GH actions also in {tic}, building on your "actions".

I see that your are putting in a lot of effort to move towards using R package binaries, even on Linux.
While this comes with a nice speed up for dependency installation, it comes with the issues of R packages which need to link against a system library.
Let's use {rJava} as the best example here ;)

I am wondering if using binaries might introduce more problems in CI than it helps - and if using source installs only (even on Windows) combined with caching the R user library might be the more robust way for most users.
However, installing certain system libs on Windows is of course a medium pain and that's also one reason why binaries exist.
If one wants to test on R-devel, source is the only option anyways.
Also I also like the idea of having the same "build process" for the dep installs across all platforms and pulling away the pain of thinking about binary/source differences at all.

Curious about your view on this.

Alias for old release?

Perhaps this is a repeat of #6

But, is there a way to avoid specifying version numbers for oldrel? Similar to:

https://docs.travis-ci.com/user/languages/r/#r-versions

The current example shows only fixed version numbers and a tag for devel.

- { os: windows-latest, r: '3.6'}
- { os: macOS-latest, r: '3.6'}
- { os: macOS-latest, r: 'devel'}
- { os: ubuntu-16.04, r: '3.2', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- { os: ubuntu-16.04, r: '3.3', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- { os: ubuntu-16.04, r: '3.4', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- { os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

Could not find function from package in parallel -- only on GH actions for Windows

I made a small reproducible example on SO: https://stackoverflow.com/q/59197177/6103040.

Basically, I get this issue only on GH actions for Windows using a similar template as you provide here (https://github.com/privefl/minipkg/blob/master/.github/workflows/main.yml).

I don't get this issue locally on Windows, nor on AppVeyor (nor on Mac or Linux builds).

I'm very confused on what is the problem.
Have you any idea where it can come from?

Run the cache command with `sudo /bin/tar`

Is your feature request related to a problem? Please describe.
I am trying to cache Ubuntu apt but it is failing with permission errors: https://github.com/evandroforks/anki/runs/527868018?check_suite_focus=true#step:32:3

      - name: Cache /var/lib/apt
        uses: actions/cache@v1
        with:
          path: /var/lib/apt
          key: ${{ runner.os }}-/var/lib/apt-${{ hashFiles('**/linux_checks.yml') }}
      - name: Cache /var/cache/apt
        uses: actions/cache@v1
        with:
          path: /var/cache/apt
          key: ${{ runner.os }}-/var/cache/apt-${{ hashFiles('**/linux_checks.yml') }}
      - name: Set up ripgrep, pyaudio, gettext, rename
        run: |
          sudo apt update
          sudo apt install portaudio19-dev gettext rename
          sudo snap install ripgrep --classic

Describe the solution you'd like
Run /bin/tar with sudo, so I can cache anything I would like.

On Windows, this is are already working because there is no sudo restrictions. There, I am caching the Git directory because I am installing the Unix Package manager (pacman) on it: https://github.com/evandroforks/anki/runs/527868075?check_suite_focus=true#step:6:16

Describe alternatives you've considered
I tried to run:

- name: Fix ~/.cache permissions
  run: |
    sudo chown -R $(whoami):$(id -ng) /var/lib/apt/
    sudo chown -R $(whoami):$(id -ng) /var/cache/apt/

But I still got permissions issues.

Tinytex setup fails on windows-latest for R3.6.X

Hi,

I have been having issues with setting up tinytex for windows-latest. My workflow is here and the failed action and log can be found here. As you can see, the windows installation just hangs and times out, while the Linux and OSX installations happen quick and proceed forward without issue.

It looks like the Windows install is expecting user input, which is what causes it to hang:

Press any key to continue . . . 
##[error]The operation was canceled.

Am I missing something in my YAML doc? Thanks for your help.

Add option to build on Linux R-devel

Currently selecting - { os: ubuntu-18.04, r: "release" } fails with

Run r-lib/actions/setup-r@master
##[error]Node run failed with exit code 1

Order of steps for check-full workflow

I think there is an issue with the logic of the steps in the check full workflow which prevents the caching feature from being used.

The depends.Rds gets created before the caching step. That means that even during a run where a cache gets restored, the depends.Rds gets created against an empty library.

Here is a sample output I see on the depends.Rds in a run where there is a cache available

Needs update -----------------------------
 package      installed available is_cran remote
 clisymbols   NA        1.2.0     TRUE    CRAN  
 crayon       NA        1.3.4     TRUE    CRAN  
 digest       NA        0.6.23    TRUE    CRAN  
 dplyr        NA        0.8.4     TRUE    CRAN  
 glue         NA        1.3.1     TRUE    CRAN  
 httr         NA        1.4.1     TRUE    CRAN  
 jsonlite     NA        1.6.1     TRUE    CRAN  
 knitr        NA        1.28      TRUE    CRAN  
 kableExtra   NA        1.1.0     TRUE    CRAN  
 purrr        NA        0.3.3     TRUE    CRAN  
 readr        NA        1.3.1     TRUE    CRAN 

Notice the NA in the installed column.

Because this depends.Rds gets used in the 'install dependencies' step, all the packages get installed regardless of whether or not they have been restored in the library from the cache.

A possible solution would be to replace in

Rscript -e "library(remotes)" -e "update(readRDS('depends.Rds'))" -e "remotes::install_cran('rcmdcheck')"
depends.Rds with another call to remotes::dev_package_deps(dependencies = TRUE)

Support for templating in actions

We currently are developing several teaching related actions (https://github.com/rundel/ghclass-actions) and it would be nice to follow the lead of the tooling being built here and in usethis. Most of our yaml files require some form of templating to customize for each class or assignment and some unified approach for this would be helpful.

The goal of this issue is to start a discussion of possible approaches and tooling either in this package or usethis.

Move from checkout@v1 to checkout@v2

Describe the bug
When jobs are re-run, a race condition (? or similar) in checkout@v1 causes jobs to error with the message fatal: reference is not a tree. 🚫 🌳

The Actions team has fixed this problem in actions/checkout@v2 (discussion in actions/checkout#23) so it would be great to move up the checkout version in check-full.yaml and similar.

To Reproduce
Here is a PR that is experiencing this behavior. Every time I click "Re-run jobs", it fails at actions/checkout@v1.

Expected behavior
When jobs are re-run, the checkout succeeds.

Suggestion for the README, mention beta end of life

The section about getting help in the README is great!

I was wondering whether it'd make sense to add an item about using a search engine and when doing so paying attention to the dates i.e. something like "Look for your error/idea in a search engine. Note that questions and answers prior to <date> refer to the now defunct beta version of GH Actions"?

Broken action links in README.md

Sorry a silly one really but just to note that the first 3 action links in the README.md all point to the setup-r action rather than setup-pandoc and setup-tinytex respectively.

Will leave just as a note if it's too trivial to PR and happy for you to just absorb and close if you aren't accepting contributions!

Unrelated: I stumbled across this (thank you!) when I was writing up an Actions workflow for publishing using bookdown/gh-pages; happy to put together a PR with this too if you think it's worthwhile in addition to pkgdown.

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.