Speed up builds of R-based lessons
authorZhian N. Kamvar <zkamvar@gmail.com>
Thu, 17 Dec 2020 19:46:31 +0000 (11:46 -0800)
committerFrançois Michonneau <francois.michonneau@gmail.com>
Fri, 18 Dec 2020 13:21:46 +0000 (14:21 +0100)
R-based lessons might take a while to build because packages need to be compiled from source. RStudio Package Manager has compiled versions of packages for ubuntu distros starting with 16.04: https://packagemanager.rstudio.com/client/#/repos/1/overview

I've added the necessary magic in the actions yaml to make it work.

.github/workflows/website.yml

index ea09543197ca812236c198941737fbccc3a5904f..2ec7dfb41a2b1d47dde04bfb40bbbcbea84b90b9 100644 (file)
@@ -7,6 +7,9 @@ jobs:
   build-website:
     if: ${{ !endsWith(github.repository, '/styles') }}
     runs-on: ubuntu-latest
+    env:
+      RSPM: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"
+      GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 
     defaults:
       run:
         shell: bash
@@ -45,6 +48,7 @@ jobs:
         uses: r-lib/actions/setup-r@master
         with:
           r-version: 'release'
+          http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions"
 
       - name: Install needed packages
         if: steps.check-rmd.outputs.count != 0