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

support r package in sub directory #393

Closed
sgratzl opened this issue Sep 22, 2021 · 5 comments
Closed

support r package in sub directory #393

sgratzl opened this issue Sep 22, 2021 · 5 comments
Labels
feature a feature request or enhancement
Milestone

Comments

@sgratzl
Copy link

sgratzl commented Sep 22, 2021

Is your feature request related to a problem? Please describe.
I want to use the setup-r-dependencies action. However, my R package is not at the root directory but in a sub directory.

Describe the solution you'd like
an option in diverse actions which allows to specify the r package location with a default to ..

Describe alternatives you've considered
none

Additional context
Add any other context or screenshots about the feature request here.

@jimhester
Copy link
Member

I have not tried this, but can you use jobs.<job_id>.defaults.run to set the default working directory for all jobs to the subdirectory?

In general we discourage people from putting R packages in subdirectories. It makes more work for your users and yourself, as even if a given tool supports subdirectories it is never the default.

@jarupatj
Copy link

I tried defaults.run and it does not work. Can we modify these actions to accept working-directory as additional parameters?

jobs:
  R:
    runs-on: ${{ matrix.os }}
    name: R - ${{ matrix.os }} (${{ matrix.r-version }})
    strategy:
      fail-fast: false
      matrix:
        r-version: [3.5]
        os: [windows-latest, ubuntu-latest]

    defaults:
      run:
        working-directory: ./R

@gaborcsardi
Copy link
Member

Does #441 and #445 solve your issue?

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Dec 9, 2021
@gaborcsardi gaborcsardi added this to the v2 milestone Dec 10, 2021
@gaborcsardi
Copy link
Member

gaborcsardi commented Dec 10, 2021

OK, with some recent changes this more or less works in the v2 tag. You have to pass the working directory to setup-r-dependencies and check-r-package:

      - uses: r-lib/actions/setup-r-dependencies@v2-branch
        with:
          extra-packages: any::rcmdcheck
          needs: check
          working-directory: subdir/dotenv

      - uses: r-lib/actions/check-r-package@v2-branch
        with:
          working-directory: subdir/dotenv

and possibly modify steps like "Show testthat output" and "Upload check results" steps if you want them.
I think I'll incorporate those in the check action and then you won't need to call them explicitly.

@github-actions
Copy link

github-actions bot commented Nov 6, 2022

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants