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

[gha] Allow to check quarto R code with a specific R package version #9932

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading