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

Add usethis as Config/Needs/website dependency #1572

Merged
merged 8 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@ jobs:
id: install-r

- uses: r-lib/actions/setup-pandoc@v1

- uses: r-lib/actions/setup-tinytex@v1

- name: Install pak and query dependencies
run: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
shell: Rscript {0}
sudo R -q -e 'install.packages("pak", lib = .Library, repos = "https://r-lib.github.io/p/pak/dev/")'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need the sudo here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was an idea suggested by @gaborcsardi, because without sudo I was told the folder was not writable.
The whole problem in this workflow is that I want to install pak from its daily repo but pak is cached with all other packages and therefore the cached version overwrites the old version.
In the end I might just change the cache name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping the -1- to -2- cleared the cache already, I guess? But this is a general problem with this workflow: if the cache is restored then an older version of pak is potentially restored as well.

We tried to install pak into .Library, so it is not cached. But that apparently needs sudo, and then the cache files are owned by root, which causes different problems.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, I'd suggest eliminating everything from this PR except for the Needs field in the DESCRIPTION and opening an issue in r-lib/actions so we fix this upstream.

sudo R -q -e 'saveRDS(pak::pkg_deps("local::.", dependencies = c("all", "Config/Needs/website")), ".github/r-depends.rds")'

- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-2-${{ hashFiles('.github/r-depends.rds') }}
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-2-

- name: Install system dependencies
if: runner.os == 'Linux'
Expand All @@ -53,7 +52,7 @@ jobs:

- name: Install dependencies
run: |
pak::local_install_dev_deps(upgrade = TRUE)
pak::local_install_dev_deps(dependencies = c("all", "Config/Needs/website"))
pak::pkg_install("pkgdown")
shell: Rscript {0}

Expand Down Expand Up @@ -89,4 +88,4 @@ jobs:
# enable-commit-status: true
#o verwrites-pull-request-comment: true
timeout-minutes: 1

2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Suggests:
VignetteBuilder:
knitr
Config/testthat/edition: 3
Config/Needs/website:
usethis
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1.9001
Expand Down