Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use R version from renv.lock in Rhino app CI #342

Closed
kamilzyla opened this issue Sep 30, 2022 · 3 comments · Fixed by #363
Closed

Use R version from renv.lock in Rhino app CI #342

kamilzyla opened this issue Sep 30, 2022 · 3 comments · Fixed by #363
Assignees
Labels
status: ready Well-defined and immediately actionable type: enhancement Minor change or improvement for existing functionality

Comments

@kamilzyla
Copy link
Collaborator

No description provided.

@kamilzyla kamilzyla added type: enhancement Minor change or improvement for existing functionality status: ready Well-defined and immediately actionable labels Sep 30, 2022
@vibalre
Copy link
Member

vibalre commented Oct 20, 2022

The R version in renv.lock should be the same as the R_VERSION specified in rhino-test.yml.

For example, .github/workflows/rhino-test.yml can be configured as

name: Rhino Test
on: push
jobs:
  main:
    name: Run linters and tests
    runs-on: ubuntu-20.04
    env:
      R_VERSION: '4.1.0'

But renv.lock can be configured as

"R": {
    "Version": "4.1.1",
    "Repositories": [
      {
        "Name": "RSPM",
        "URL": "https://packagemanager.rstudio.com/all/latest"
      }
    ]
  }

We want the rhino-test.yml to use R_VERSION: '4.1.1'.

@vibalre
Copy link
Member

vibalre commented Oct 24, 2022

@kamilzyla I am stuck with #77, so I tried this one.

Solution

I removed the env definition of R_VERSION and added this step.

- name: Extract R.version from renv.lock
        run: |
          r_version=`jq .R.Version renv.lock | xargs`
          echo "R_VERSION=$r_version" >> $GITHUB_ENV

Tests

Here are the tests I did with rhino-showcase:

I forgot to keep GITHUB_PAT when I removed R_VERSION from env. For some reason, Cypress fails in R 4.2.1.

Please check if these results are ok.

@vibalre vibalre self-assigned this Oct 24, 2022
@kamilzyla
Copy link
Collaborator Author

Hi @vibalre! Good call on taking some other task when you got stuck 🙂 👍 Overall I like your idea here (additional CI workflow step to extract R version into an environment variable). Please start a PR so we can discuss the technical details there.

vibalre added a commit that referenced this issue Oct 26, 2022
Feat: Use `renv.lock` `R` Version in CI

closes #342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready Well-defined and immediately actionable type: enhancement Minor change or improvement for existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants