nmfs-fish-tools / ghactions4r

Reusable github actions workflows for R packages
https://nmfs-fish-tools.github.io/ghactions4r/
12 stars 1 forks source link

Ubuntu 20.04 r devel R CMD check fails #6

Closed Bai-Li-NOAA closed 2 years ago

Bai-Li-NOAA commented 2 years ago

Issue I got following error when running R CMD check on Ubuntu 20.04 and 18.04 builds with R devel using the r-cmd-check.yml. The GitHub Actions log can be found here.

Run rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check")
Error: Error in loadNamespace(x) : there is no package called ‘rcmdcheck’
Calls: loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Error: Process completed with exit code 1.

Potential solutions and questions 1) Add following section to set up r dependencies (r-lib/actions example and usethis example) before Check. It worked when I put r-lib/actions/setup-r-dependencies@v1 between r-lib/actions/setup-r@master and r-lib/actions/setup-pandoc@master.

- uses: r-lib/actions/setup-r-dependencies@v1
        with:
          extra-packages: rcmdcheck

2) Not run r-cmd-check on r-devel since users often run r CMD check on a released version of R? I also wonder if we need to specify version numbers under the config section. For example, could we use ubuntu-latest, r release, r oldrel-1, and r oldrel-2, etc?

Let me know if you have any questions. Happy to help modify the yml file and submit a pull request.

k-doering-NOAA commented 2 years ago

@Bai-Li-NOAA , I think what probably happened was an issue with the packages not being available for the development version of r at the moment the job was run - this sometimes happens. I wonder if rerunning the job would be successful?

Given that development sometimes fails and can be confusing for users, I think 2. is a good idea. The only reason I like to run on development is to know if there will be problems ahead of time (e.g., the switch to r 4.0.0 had some big changes that required some code changes), but I agree that the job fails falsely more often than it should.

Also, sure, we can use the relative version numbers instead, and I think that is a great idea! Feel free to submit a PR to change the yml :)

Thanks for all the help making these files more generalized!

Bai-Li-NOAA commented 2 years ago

Yes, rerunning the job helps resolve the issue. Will work on submit a PR.