Skip to content

Commit

Permalink
Merge pull request #9932 from quarto-dev/gha/run-test-extra-r-pakages
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Jun 10, 2024
2 parents f1ab12b + 15b568d commit 8993510
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test-smokes-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
required: true
default: 10
type: number
extra-r-packages:
description: "extra R package to install for the tests runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
required: false
type: string
default: ""
pull_request:
branches:
- main
Expand Down Expand Up @@ -82,3 +87,4 @@ jobs:
uses: ./.github/workflows/test-smokes.yml
with:
buckets: ${{ matrix.buckets.files }}
extra-r-packages: ${{ inputs.extra-r-packages }}
18 changes: 16 additions & 2 deletions .github/workflows/test-smokes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
required: false
type: boolean
default: false
extra-r-packages:
description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
required: false
type: string
default: ""
workflow_dispatch:
inputs:
buckets:
Expand All @@ -25,12 +30,17 @@ on:
required: false
type: boolean
default: false
extra-r-packages:
description: "extra R package to install for the runs (like a dev version of one of the deps) - comma separated, passed to renv::install"
required: false
type: string
default: ""
schedule:
- cron: "0 6 * * *"

jobs:
run-smokes:
name: Run smoke (${{ matrix.os }})${{ matrix.time-test && ' with timed file' || ''}}
name: Run smoke (${{ matrix.os }})${{ matrix.time-test && ' with timed file' || ''}}${{ inputs.extra-r-packages && ' - with some extra R packages'|| ''}}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -101,7 +111,7 @@ jobs:
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2-${{ hashFiles('tests/renv.lock') }}
restore-keys: |
${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-renv-2-
save-always: true
save-always: ${{ inputs.extra-r-packages == '' }} # don't save cache if we have extra R packages

- name: Install missing system deps
if: runner.os == 'Linux'
Expand All @@ -121,6 +131,10 @@ jobs:
# Use r-universe to avoid github api calls
try(install.packages('knitr', repos = 'https://yihui.r-universe.dev'))
try(install.packages('rmarkdown', repos = 'https://rstudio.r-universe.dev'))
if ('${{ inputs.extra-r-packages }}' != '') {
cat(sprintf("::notice::Running with the following extra R packages for pak: %s\n", "${{ inputs.extra-r-packages }}"))
renv::install(strsplit("${{ inputs.extra-r-packages }}", split = ",")[[1]])
}
shell: Rscript {0}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 8993510

Please sign in to comment.