Skip to content

Commit

Permalink
Enable R package caching (#2)
Browse files Browse the repository at this point in the history
* Based on usethis check-full.yaml example.
  • Loading branch information
riccardoporreca committed Mar 16, 2020
1 parent 3914dca commit 2280248
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,34 @@ jobs:
CI-CD:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master

- name: Query dependencies
run: |
install.packages("remotes"")
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-

- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck", "rsconnect"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- name: R CMD check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Deploy to shinyapps.io
if: github.ref == 'refs/heads/feature/2-gh-actions-ci-cd'
env:
Expand Down

0 comments on commit 2280248

Please sign in to comment.